Question: please modify the code so that the program runs with out bugs. no mutex or semphore or atomic. the program cannot have any synchronization #include
please modify the code so that the program runs with out bugs. no mutex or semphore or atomic. the program cannot have any synchronization
#include
#include
#include
#include
#include
using namespace std;
typedef int item;
int bufferSize;
int reps;
vectorbuffer;
int in;
int counter ;
int out;
void producer
while counter bufferSize;
cout "Enter counter limit: ;
cin reps;
bufferbufferSize;
thread prod producer;
thread cons consumer;
prod.join;
cons.join;
return ;
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
