Sync(oswego)vs Lock(JDK5)

时间:2009-03-31 02:49:51

标签: java multithreading concurrency

可以肯定的是,专家可以确认

java.util.concurrent.locks.Lock

和Doug Lea的原始Sync

基本上是相同的,但名称不同。

  • 获得vs锁
  • 发布与解锁

2 个答案:

答案 0 :(得分:1)

实现Lock的ReentrantLock包装一个名为Sync的类。所有这些都是Doug Lea写的。我建议你尝试在Java中使用这些库。

答案 1 :(得分:0)

对于它的价值,java.util.concurrent.locks.Lock的源代码将Doug Lea列为其作者。该包中的许多其他文件也是如此。

   /*
    * This file is available under and governed by the GNU General Public
    * License version 2 only, as published by the Free Software Foundation.
    * However, the following notice accompanied the original version of this
    * file:
    *
    * Written by Doug Lea with assistance from members of JCP JSR-166
    * Expert Group and released to the public domain, as explained at
    * http://creativecommons.org/licenses/publicdomain
    */