JAVA线程的高级同步[17]

[入库:2006年2月23日] [更新:2007年3月24日]

本文简介:

    Lock readLock( );

    Lock writeLock( );

}

 

public class ReentrantReadWriteLock implements ReadWriteLock {

    public ReentrantReadWriteLock( );

    public ReentrantReadWriteLock(boolean fair);

    public Lock writeLock( );

    public Lock readLock( );

}

You create a reader-writer lock by instantiating an object using the ReentrantReadWriteLock class. Like the ReentrantLock class, an option allows the locks to be distributed in a fair fashion. By "fair," this class means that the lock is granted on very close to a first-come-first-serve basis. When the lock is released, the next set of readers/writer is granted the lock based on arrival time.

本文关键:JAVA线程的高级同步
  相关方案
Google
 

本站最佳浏览方式为 分辨率 1024x768 IE 6.0(或更高版本的 IE浏览器)

go top