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. Django Admin定制

    Django内置的Admin是对于model中对应的数据表进行增删改查提供的组件,使用方式有: 依赖APP: django.contrib.auth django.contrib.contenttyp ...

  2. 模仿VIMD的模式的简化代码示例

    按numpad0来切换模式,按t显示不同的结果: Numpad0:: tfmode:=!tfmode aaa:=(tfmode=?"AAAA":"BBBB") ...

  3. mysql-4连接

    联合多表查询 菜鸟教程join 日常应用较多的是从多个表格中获取数据.使用join可以在多个表查询进行select.update.delete. join按照功能分为三类: inner join(内连 ...

  4. TCL列表

    列表是Tcl的基本可用数据类型之一.它是用于表示项目的有序集合.它可以包括不同类型的在同一列表的项目.此外,一个列表可以包含另一个列表. 需要注意的一个重要的事情是,列表表示为完全串并处理在需要时,形 ...

  5. 关于RouterOS 国内DDNS服务

    虽然RouterOS 加入了cloud功能,但最近在配置RB2011的时候发现不好使,更新域名后无法正确解析到我的IP地址,虽然在cloud的public address中显示了正确的公网ip地址,但 ...

  6. 无法正确解析FreeMarker视图

    在使用SpringMVC处理FreeMarker的时候,出现了无法解析视图名的问题,报的异常说明的也非常清楚就是不能解析视图 这个free就是一个FreeMarker的模板名,它的完整路径是/WEB- ...

  7. three3D地图

    终于闲下来了,前段时间做了个项目,高精度精准定位系统,用到了three3D地图 听起来是不是很炫酷?其实并不难.先把部分代码附上(文件比较多,只粘贴部分的) $(function () {     i ...

  8. ASP.NET web 应用程序项目

    ASP.NET web  应用程序项目 .ashx .ashx.cs aspx包括前台一些代码要处理,ashx可以看作是没有aspx页面中前台代码的后台.cs文件. 没有了前台代码,服务器负担少一点, ...

  9. ManagedProperty not injected in @FacesConverter

    I'm trying to inject a ManagedBean in my FacesConverted the following way: @ManagedBean @RequestScop ...

  10. PIN 引脚类型

    一个 capture filter 通常有两个或更多个输出相同类型数据的输出引脚,例如预览引脚和捕捉引脚.因此,媒体类型不是区分引脚的好方法. //相反,这些引脚通过它们的功能来区分,这些功能是使用称 ...