lqxue

          常用鏈接

          統計

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


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


          網站導航:
           
          主站蜘蛛池模板: 勃利县| 那曲县| 溧阳市| 高平市| 玛沁县| 绥棱县| 渝北区| 会东县| 宁南县| 昭通市| 延津县| 长垣县| 九台市| 丹凤县| 东兰县| 依兰县| 肥东县| 昭觉县| 桦川县| 全州县| 油尖旺区| 武冈市| 秦安县| 红桥区| 靖宇县| 陆丰市| 嘉义市| 土默特左旗| 贞丰县| 成安县| 全椒县| 全州县| 龙岩市| 无极县| 河津市| 辽源市| 镇巴县| 广河县| 垦利县| 晋城| 富民县|