The purpose of this assignment is to construct a “monitor “ that will manage a multi-element storage buffer for multiple consumer and producer threads. You must design and build the monitor mechanism to ensure mutual exclusion and to include condition variables. To accomplish this, your monitor should be able to provide the monitor signal() and wait() functions for the application threads. You will need to implement these functions using both your own constructed semaphores and spinlocks, _or_ you can use the semaphore functions provided by your operating system. Your implementation of the monitor and monitor functions should take the general approach, and NOT restrict signal operations to be the last operation of the monitor procedure. You are to construct the monitor to include the APPEND and TAKE functions.
The consumer-producer solution should permit multiple producer threads and multiple consumer threads to execute concurrently. As in past assignments, you should include a descriptive document of your solution, a test methodology, and a log demonstrating that the solution works properly.
The second part of this project is to re-construct the monitor functionality (completed in Part One) using the pthread_mutex_lock and pthread_mutex_unlock, pthread_cond_signal and pthread_cond_wait functions available in the pthread library (obviously those functions and features should not be used in part 1). Show and explain the results of the Part Two implementation. Include a discussion of comparison between the two different methods of implementation and any differences in results or performance.
1) Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
2) you should include a descriptive document of your solution, a test methodology, and a log demonstrating that the solution works properly.