1.) The following table summarizes several versions of the Producer/Consumer problem.


producers/consumers | buffer size | single/double ended | semaphores | mutexes
-------------------------------------------------------------------------------
     single             infinite         double               1	         0
     single             infinite         single               1	         1
     single             bounded          double               2	         0
     single             bounded          single               2	         1
     multiple           infinite         double               1	         1 or 2
     multiple           infinite         single               1	         1
     multiple           bounded          double               2	         1 or 2
     multiple           bounded          single               2          1


Try writing out the solution to each of these problems.
Also, make a similar table for condition variables,
and try writing out the appropriate solutions.



2.) In the classic, one mutex and two counting semaphores solution

Producer			      Consumer
{				      {
   create(&item);     		         wait(semaphoreEmpty);
   wait(semaphoreFull);		         wait(lock);
   wait(lock);			         getOut(&item);
   putIn(&item);			 release(lock);
   release(lock);		         signal(semaphoreFull);
   signal(semaphoreEmpty);	         use(&item);
}   				      }

it is OK to reverse the order of the release() and signal() (but it is not really a good idea)
but it is a mistake to reverse the order of the two wait() calls.