Question: Task 1 - Implement a bounded buffer. This will be a buffer of pointers to Matrix structs ( records ) . The datatype should be
Task Implement a bounded buffer. This will be a buffer of pointers to Matrix structs records The
datatype should be Matrix bigmatrix and the bounded buffer will be limited to
BOUNDEDBUFFERSIZE size. Note: the demo code has it in the pcmatrix.c and similar idea can be
borrowed.
Task Implement get and put routines for the bounded buffer.
Task Call put from within prodworker and add all necessary uses of mutex locks, condition
variables, and signals. Integrate the counters.
Task Call get from within consworker and all necessary uses of mutex locks, condition variables,
and signals. Integrate the counters. Implement the matrix multiplication by consuming matrices from
the bounded buffer as described above.
Task Create one producer pthread and one consumer pthread in pcmatrix.c to launch the parallel
matrix production and multiplication.
Tasks Once a producer and consumer version of the program is working correctly, refactor
pcmatrix.c to use an array of producer threads, and an array of consumer threads. The array size is
numw. Extra credit for correct implementation of or more producerconsumer pthreads
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
