由买买提看人间百态
登录
首页
论坛
未名存档
话题女王
小圈子
马甲追踪
版面排名
流量曲线
水枪排名
发帖量曲线
发帖版面饼图
发帖时间柱图
关于本站
帮助
boards
本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字
访问原贴
Java版
- 这个Method为什么需要同步?
相关主题
●
发现 synchronized 的一个问题
●
synchronization for counters
●
同一个Lock锁两次,性能比较差
●
synchronization 锁住了什么?
●
问一个基础问题
●
新手问个multi-threading关于synchronized和volatile的问题
●
请教:怎么把synchronize的method改成用thread 但thread safe呢?
●
Talk a little more about How to lock a file
●
synchronized method does lock the object that passed into the method as a parameter?
●
请教一个多线程lock机制的问题
●
multi-threading guru们 (转载)
●
怎么synchronize时间捏
●
CC150 16.6答案是不是有问题? (转载)
●
HashMap cache
●
Java synchronized method一问
●
Apply lock on a class.
相关话题的讨论汇总
话题: getcount
话题: count
话题: method
话题: public
进入Java版参与讨论
1
(共1页)
u*l
发帖数: 1943
1
public class Students {
private int count;
public synchronized int getCount(){
return count;
}
}
感觉getCount()只是返回一个属性值,不需要lock保护啊。
z****e
发帖数: 54598
2
setCount的那个方法也有synchronized吧
r*****l
发帖数: 2859
3
Methods that set the count should be sync-ed too. Cannot you see the code?
【在 z****e 的大作中提到】
: setCount的那个方法也有synchronized吧
r*****l
发帖数: 2859
4
Oops, re-ed to wrong person :)
【在 r*****l 的大作中提到】
: Methods that set the count should be sync-ed too. Cannot you see the code?
1
(共1页)
进入Java版参与讨论
相关主题
●
Apply lock on a class.
●
synchronized method does lock the object that passed into the method as a parameter?
●
请教:performance issue
●
multi-threading guru们 (转载)
●
java的volatile
●
CC150 16.6答案是不是有问题? (转载)
●
Java concurrency的疑惑,难道我理解错了? (转载)
●
Java synchronized method一问
●
发现 synchronized 的一个问题
●
synchronization for counters
●
同一个Lock锁两次,性能比较差
●
synchronization 锁住了什么?
●
问一个基础问题
●
新手问个multi-threading关于synchronized和volatile的问题
●
请教:怎么把synchronize的method改成用thread 但thread safe呢?
●
Talk a little more about How to lock a file
相关话题的讨论汇总
话题: getcount
话题: count
话题: method
话题: public
未名新帖统计
// 7月16日
#
版面
帖数(主题数)
-
全站
4871 (796)
1
Military
3777 (569)
2
Stock
341 (51)
3
Joke
117 (17)
4
History
116 (3)
5
Automobile
100 (9)
6
USANews
55 (9)
7
Midlife
45 (1)
8
Headline
41 (41)
9
Dreamer
33 (13)
10
FleaMarket
32 (20)
11
Living
30 (7)
* 这里只显示发帖超过25的版面,努力灌水吧:-)
历史上的今天
faintcat妹妹看进来~~
发表于12年前.
NSC, PD 1/7/2007, EB2, ...
发表于11年前.
[FBA求购]MJVE2 758 MJVM2 ...
发表于6年前.
老生常谈,归与不归
发表于10年前.
【申请】Seattle西雅图 版版主——申请人...
发表于9年前.
宝宝出生,头骨骨折,求祝福
发表于9年前.
求推荐舒缓优美的古典音乐
发表于11年前.
百分之一的北京人上北大 中国网友愤怒(转载)
发表于10年前.
新人带狗狗Bailey来报道
发表于12年前.
全世界最有价值的运动队
发表于10年前.
请问大切诺基的质量如何
发表于6年前.
TNND,军版全是BKC
发表于15年前.
Inception
发表于12年前.
微软的有些家属可真恶心,为了卖保险脸都不要了
发表于10年前.
每周坐高铁的苦逼来说说感受吧!!
发表于9年前.