Ejemplo n.º 1
0
        public static void RunExample()
        {
            SharedBuffer buffer = new SharedBuffer(8);
            Producer     p      = new Producer(buffer);
            Consumer     c      = new Consumer(buffer);

            Thread producer = new Thread(new ThreadStart(p.Run));
            Thread consumer = new Thread(new ThreadStart(c.Run));

            producer.Start();
            consumer.Start();

            producer.Join();
            consumer.Join();
        }
Ejemplo n.º 2
0
 public Consumer(SharedBuffer myBuffer)
 {
     this.buffer = myBuffer;
 }
Ejemplo n.º 3
0
 public Producer(SharedBuffer myBuffer)
 {
     this.buffer = myBuffer;
 }