Home > OS >  The reader writer problem!!
The reader writer problem!!

Time:11-16

The reader - writer problem
(1) course designed to
Through this course design, requiring Linux process creation method, master the operation method of documents, to grasp the method of the use of a semaphore,
(2) the design requirements of the class
Problem description:
A data file can be Shared by multiple processes, among them, some processes require read (reader), and other process requirements to write or modify the data (writer), allowing multiple process of reader read a Shared object at the same time, because the read operation will not make chaos data file, but will never allow a writer processes and other reader/writer process access to a Shared object at the same time, the so-called "reader - writer problem" refers to ensure a writer process and other processes must be mutually exclusive access to a Shared object synchronization problems,
This topic is designed to implement the system requirements for the following functions:
L to create a file sharefile deposited as Shared data files,
L to create two reader process and writer process, four processes sharing using file sharefile,
L use the semaphore mechanism, write "reader - writer problem" the implementation of the code, make each writer process and other processes sharefile mutually exclusive access to a Shared file,
L ask for compilation used makefile,

CodePudding user response:

Could you tell me the write good?

CodePudding user response:

With multiple terminal how run, feel this topic and find the reader writer problem is different,
  • Related