zoukankan      html  css  js  c++  java
  • IntricCondition和expliciteCondition比较

       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] 

  • 相关阅读:
    gzip是一种数据格式,deflate是一种压缩算法
    js 实现图片上传 续
    iframe 元素会创建包含另外一个文档的内联框架(即行内框架)
    HTTPS简介----
    回归测试
    HTTP 返回码 400
    js 实现 一张图片的上传
    121. Best Time to Buy and Sell Stock
    119. Pascal's Triangle II
    118. Pascal's Triangle
  • 原文地址:https://www.cnblogs.com/zhaoxinshanwei/p/7652813.html
Copyright © 2011-2022 走看看