edu.unima.ky.parallel
Class SyncChannel

java.lang.Object
  |
  +--edu.unima.ky.parallel.SyncChannel

public class SyncChannel
extends java.lang.Object

This SyncChannel class implements a shared memory communication channel in the same way as the class BoundedBuffer does. It has only a capacity to transport one object. With the method send objects are placed into the channel, and with the receive objects are taken from the channel. send blocks if there is no space to place a object into the channel and until a corresponding receive is executed. recieve blocks if there is no object in the channel. The objects are put to and get from the channel in FIFO order.

See Also:
Queue, Deque, Channel, MemoryChannel, Stack, BoundedBuffer

Constructor Summary
SyncChannel()
          Constructs a synchrnous Channel
 
Method Summary
 java.lang.Object receive()
          Receives an object from the channel
 void send(java.lang.Object v)
          Sends an object to the channel.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SyncChannel

public SyncChannel()
Constructs a synchrnous Channel

Method Detail

send

public void send(java.lang.Object v)
Sends an object to the channel. Blocks until the object is received.


receive

public java.lang.Object receive()
Receives an object from the channel