Question: C++ Code Requried...!!! Consider a system that has two threads, ThreadA and is a shared butter pool that starts with 10 buffers. There is a
C++ Code Requried...!!!

Consider a system that has two threads, ThreadA and is a shared butter pool that starts with 10 buffers. There is a queue for passing information between the threads ThreadB. There ThreadA repeat 5000 times f get a buffer put some data in the buffer put the buffer on the queue; ThreadB repeat 5000 times; get a buffer from the queue; get another buffer from the pool; perform a calculation on the data; release both buffers; The thread speed cannot be predicted. One thread may run much faster than another. and synchronization. OUTPUT Thread A fills the buffer Thread A puts buffer on queue Thread B gets buffer from queue Thread B gets another buffer from the pool Thread B does some calculations Thread B puts both buffers back into pool
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
