[concurrency-interest] Waiting for object value to be available.

Gregg Wonderly gregg at cytetech.com
Tue Aug 23 09:18:21 EDT 2005



Peter Veentjer - Anchor Men wrote:
> I want some kind of container that can store an object. Multiple threads 
> can read a value from that container, and if there is no object 
> available (the value is null) they are going to sleep (or sleep untill a 
> timeout occurs). If there is a value available, all threads that where 
> sleeping wake up.. and read the value (but don`t remove it like a in 
> blockingqueue)

This is what the whole j.u.c.Future interface is for.  Have a look there
and the pointers from that Javadoc to FutureTask etc.

Gregg Wondely


More information about the Concurrency-interest mailing list