ASSIGNMENTS for Lab Session 2


  1. 1

    Define the interface for a bounded buffer, containing the methods put() and take() for inserting/extracting elements.

  2. 2

    Develop an implementation of a bounded buffer that makes use of explicit locks and condition variables.

  3. 3

    Develop a driver program that, spawning producer and consumer threads, show the behavior of the bounded buffer.

  4. 4

    Develop an implementation of a bounded buffer that makes use of Semaphores.

  5. 5

    Develop an implementation of a bounded buffer that exploits an instance of a BlockingQueue.