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


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


          網站導航:
           
          主站蜘蛛池模板: 昌吉市| 且末县| 翼城县| 彰化市| 富川| 乐清市| 大埔区| 仙居县| 民权县| 曲靖市| 平陆县| 泰来县| 汝阳县| 新田县| 梓潼县| 库车县| 白朗县| 泰安市| 闸北区| 琼中| 同德县| 临沧市| 郯城县| 武邑县| 西和县| 宾阳县| 玉田县| 柯坪县| 嵊泗县| 中西区| 通州市| 旺苍县| 交城县| 明光市| 来宾市| 墨竹工卡县| 荆门市| 县级市| 文山县| 凤庆县| 楚雄市|