Subject: OPERATING SYSTEM
Q) Elaborate the concept of shared memory model with the help of the producer-consumer problem. The producer-consumer problem discussed below is correct; however, it stores buffer_size-1 processes. How can we solve this issue?
item nextProduced:
while (1) {
while (counter == BUFFER_SIZE); /* do nothing */
buffer[in] = nextProduced;
in = (in + 1) % BUFFER_SIZE;
counter++;
}