2.2 ipc
This exercise is optional.
Refer to the exercise policy for details.
Implement a threaded multi-consumer/multi-producer queue using a
finite ring buffer and the POSIX threading API for
mutexes. Parameterize your implementation (number of consumers,
producers, size of queue, etc) such that you can experiment on
it. Discover parameters that always (100%), never (0%),
randomly (50%), mostly (75%), and infrequently (25%) end in deadlock.