IntricCondition 和 expliciteCondition 的区别 与 intrinsicLoc和expliciteLock的区别很相似, expliciteCondition提供了更多的功能,比如,fair和unfair的wait,notify

不同conditionPredictes 使用不用的condition,不同的waitSet, 一个expliciteLock可以有多个conditon.

不同的conditionPredicates使用不同的codition,一方面代码比较好读,另一方面,减少了无效的notifyAll(),减少了不必要的线程切换.

There  is  an  important  three‐way  relationship  in  a  condition  wait  involving  locking,  the  wait   method,  and  a  condition
predicate.  The  condition  predicate  involves  state  variables,  and  the  state  variables  are  guarded  by  a  lock,  so  before
testing the condition predicate, we must hold that lock.

Just as with built‐in locks and condition queues, the three‐way relationship among the lock, the condition predicate, and
the condition variable must also hold when using explicit  Lock s and  Condition s. The variables involved in the condition
predicate  must  be  guarded  by  the  Lock ,  and  the  Lock   must  be  held  when  testing  the  condition  predicate  and  when
calling  await  and  signal . [11]

IntricCondition和expliciteCondition比较的更多相关文章

随机推荐

  1. SQL中禁用trigger

    SQL中禁用所有trigger   编写人:CC阿爸 2014-6-15 在日常SQL数据库的操作中,如何快速的禁用所有trigger? --禁用某个表上的所有触发器 ALTER  

  2. 关于 android百度地图 调用 地理位置 经纬度坐标,只调用一次的解决方法,通知栏不总是 搜索 GPS 。。。

    上代码吧... //读取当前坐标 final LocationClient mLocationClient = new LocationClient(mActivity); mLocationClie ...

  3. Log4j(3)--rootLogger根配置和appender输出类型配置

    参考博客:http://blog.java1234.com/blog/articles/270.html 一.rootLogger根配置: Log4j 根配置语法 log4j.rootLogger = ...

  4. arm-linux-gcc配置安装

    1.首先去下载arm-linux-gcc压缩包 https://pan.baidu.com/s/15QLL-mf0G5cEJbVP5OgZcA 密码:ygf3 2.把压缩包导入到Linux系统:htt ...

  5. python报头解决粘包简单实现

    client------------- #!/usr/bin/env python # encoding: utf-8  # Date: 2018/6/5 import socketimport st ...

  6. QQ中的国家城市数据。

    在QQ安装目录可以找到loclist.xml文件 C:\Program Files\Tencent\QQ\I18N\2052 以上是中文版,若需要英文版,可安装国际版...在1033目录 code都是 ...

  7. Sql语句在线转java bean https://www.bejson.com/othertools/sql2pojo/

    https://www.bejson.com/othertools/sql2pojo/

  8. eclipse 预览Android界面报错

    This version of the rendering library is more recent than your version of ADT plug-in. Please update ...

  9. PHP截取中文不乱吗

    function utf_substr($str, $len) { for ($i = 0; $i < $len; $i++) { $temp_str = substr($str, 0, 1); ...

  10. HTTP 返回码 400

    400(错误请求)服务器不理解请求的语法 404表示页面不存在 返回500表示内部服务出错, 返回301表示资源永久性跳转 HTTP 500 – 内部服务器错误 HTTP 500.100 – 内部服务 ...