lqxue

          常用鏈接

          統(tǒng)計

          book

          tools

          最新評論

          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 閱讀(245) 評論(0)  編輯  收藏


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


          網(wǎng)站導航:
           
          主站蜘蛛池模板: 永清县| 积石山| 郎溪县| 红安县| 固始县| 三穗县| 清镇市| 阿城市| 三台县| 巴塘县| 墨竹工卡县| 三穗县| 什邡市| 黄石市| 黑龙江省| 无锡市| 灵石县| 深泽县| 宕昌县| 巴南区| 肇源县| 巴塘县| 蛟河市| 大厂| 临清市| 社会| 万安县| 会宁县| 茂名市| 临夏县| 洪泽县| 龙川县| 革吉县| 襄汾县| 东阳市| 启东市| 石台县| 营口市| 伊金霍洛旗| 烟台市| 广德县|