dogsnsa.blogg.se

Os readers and writers
Os readers and writers




os readers and writers os readers and writers

The solution for the producer is to either go to sleep or discard data if the buffer is full. The problem is to make sure that the producer won't try to add data into the buffer if it's full and that the consumer won't try to remove data from an empty buffer. At the same time, the consumer is consuming the data (i.e., removing it from the buffer) one piece at a time. The producer's job is to generate a piece of data, put it into the buffer and start again. The problem describes two processes, the producer and the consumer, who share a common, fixed-size buffer used as a queue. The bounded-buffer problem (or, produce consumer problem) is a classic example of a multi-process synchronization problem. Read two popular synchronization problems: Bounder buffer and reader-writer problems. Upon completion you should be more comfortable creating robust multithreaded applications that use shared variables. You will be using these primitives to solve two classic synchronization problems: Bounded Buffer, and Readers/Writers. This assignment will familiarize you with the process synchronization primitives Semaphore, Lock, and Condition.






Os readers and writers