Home » concurrent-sources » EDU.oswego.cs.dl.util.concurrent » [javadoc | source]
EDU.oswego.cs.dl.util.concurrent
public class: SynchronousChannel [javadoc | source]
java.lang.Object
   EDU.oswego.cs.dl.util.concurrent.SynchronousChannel

All Implemented Interfaces:
    BoundedChannel

A rendezvous channel, similar to those used in CSP and Ada. Each put must wait for a take, and vice versa. Synchronous channels are well suited for handoff designs, in which an object running in one thread must synch up with an object running in another thread in order to hand it some information, event, or task.

If you only need threads to synch up without exchanging information, consider using a Barrier. If you need bidirectional exchanges, consider using a Rendezvous.

[ Introduction to this package. ]

Nested Class Summary:
protected static class  SynchronousChannel.Queue  Simple FIFO queue class to hold waiting puts/takes. 
Field Summary
protected static final  Object CANCELLED    Special marker used in queue nodes to indicate that the thread waiting for a change in the node has timed out or been interrupted. 
protected final  Queue waitingPuts     
protected final  Queue waitingTakes     
Method from EDU.oswego.cs.dl.util.concurrent.SynchronousChannel Summary:
capacity,   offer,   peek,   poll,   put,   take
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from EDU.oswego.cs.dl.util.concurrent.SynchronousChannel Detail:
 public int capacity() 
 public boolean offer(Object x,
    long msecs) throws InterruptedException 
 public Object peek() 
 public Object poll(long msecs) throws InterruptedException 
 public  void put(Object x) throws InterruptedException 
 public Object take() throws InterruptedException