lqxue

          常用鏈接

          統(tǒng)計(jì)

          book

          tools

          最新評(píng)論

          difference between Synchronized method and Synchronized block

          Synchronized method - By using this, the method will be thread safe. But if your method access any non-thread safe objects, you may have concurrency problem.

          Synchronized block - To complement what Synchronized method cannot do. If you do:

          synchronized (nonThreadSafeObject) {
          // accessing nonThreadSafeObject here
          }

          Then the object will become thread safe.

          posted on 2007-06-29 16:50 lqx 閱讀(244) 評(píng)論(0)  編輯  收藏


          只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 精河县| 瑞金市| 广州市| 瓮安县| 海宁市| 舞钢市| 绥江县| 炉霍县| 临武县| 福建省| 凌海市| 阿勒泰市| 阿拉尔市| 澄迈县| 尚义县| 资源县| 漠河县| 丰镇市| 沙坪坝区| 游戏| 江永县| 高雄市| 会昌县| 邮箱| 淳安县| 志丹县| 鸡西市| 金溪县| 仙桃市| 三台县| 莎车县| 永仁县| 石嘴山市| 怀来县| 尤溪县| 大丰市| 宝应县| 新竹市| 乐业县| 淮安市| 阿克苏市|