/// <summary>
 /// Instanciates a new Inter-Thread mailbox.
 /// </summary>
 public ThreadMailBox()
 {
     empty = new ThreadSemaphore(1, 1);
     full  = new ThreadSemaphore(0, 1);
 }
Example #2
0
 /// <summary>
 /// Instanciate a new Inter-Thread message channel.
 /// </summary>
 /// <param name="size">The count of messages the channel can queue before it blocks.</param>
 public ThreadChannel(int size)
 {
     queue = Queue.Synchronized(new Queue(size));
     empty = new ThreadSemaphore(size);
     full  = new ThreadSemaphore(0);
 }
Example #3
0
 /// <summary>
 /// Instanciates an Inter-Thread rendez-vous.
 /// </summary>
 public ThreadRendezVous()
 {
     left  = new ThreadSemaphore(0);
     right = new ThreadSemaphore(0);
 }
 /// <summary>
 /// Instanciates an Inter-Thread rendez-vous.
 /// </summary>
 public ThreadRendezVous()
 {
     left = new ThreadSemaphore(0,1);
     right = new ThreadSemaphore(0,1);
 }
Example #5
0
 /// <summary>
 /// Instanciate a new Inter-Thread message channel.
 /// </summary>
 /// <param name="size">The count of messages the channel can queue before it blocks.</param>
 public ThreadChannel(int size)
 {
     queue = Queue.Synchronized(new Queue(size));
     empty = new ThreadSemaphore(size,size);
     full = new ThreadSemaphore(0,size);
 }