Question: A very simple OS may be represented as a set of three threads interacting as follows: Process Simple_OS; reader_thread { } while (1) {

A very simple OS may be represented as a set of three threads interacting as follows: Process Simple_OS; reader_thread { } while (1) { } } main_body_thread { while (1) { } read data from input device; deposit data in input_buffer; } fetch data from input_buffer; process data and generate output result; deposit result in output_buffer; display_thread { while (1) { fetch result from output_buffer; display result on output device } The simple OS suffers with concurrency issue. Modify and augment this simple OS using semaphore operations to properly buffer the input data that flows from the reader to the main body, and the output result that flows from main body to the display. Assume that both input and output buffers have N buffers and the fetch statement can access the buffers correctly. You have to make use of semaphores to coordinate amongst the three threads. Remember to properly initialize the semaphores before using them (similar to the approach adopted in the lecture note, e.g., slide # 28 of Lecture note 06- Synchronization).
Step by Step Solution
There are 3 Steps involved in it
To address the concurrency issue in the given simplified operating system using semaphores you can synchronize the operations of the three threads Sem... View full answer
Get step-by-step solutions from verified subject matter experts
