[concurrency-interest] Fwd: ReadWriteLocks and Conditions
tim at peierls.net
Tue Feb 6 17:42:59 EST 2007
LendableReference is essentially a resource pool of size 1. Other folks have
done a lot of work on the general case -- why not take advantage of that?
Or if you really want to roll your own, consider using Semaphores, as
described in section 5.5.3 of Java Concurrency in Practice.
On 2/6/07, Peter Veentjer <alarmnummer at gmail.com> wrote:
> Example usage:
> Runnable task = lendableRef.take();
> By placing a Runnable in the lendableRef, the task is being executed.
> By removing the Runnable from the lendableRef (so setting a null
> value) the take blocks.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Concurrency-interest