CSE531 Project 2A
Suggested Due date: November 24
Do NOT submit

Problem:

Rewrite the message passing library implemented in Project 1, but with
  1. One "mutex" semaphore, controlling all shared memory access (buffer read and write)
  2. One semaphore per process controlling the process blocking when necessary.

Approach:

Initialize the mutex semaphore to 1 and the blocking semaphores to 0. Each application process is supposed to have a process id, this process id is used as the semaphore id of the blocking sempahore it uses. The process id can be same as the reply port id chosen by the process. 

The shared memory used for buffers and ports will have to be augmented to contain the waiting process list. You may have the waiting process list as a statically allocated memory slots (assume a max of 10 processes).

If necessary you may reduce the number of ports and/or number of buffers per port to accommodate your data structures in shared memory.

Testing:

Same as project 1.