Computers and Technology

7 processes are characterized by 4 readers and 3 writers. Up to three reader processes can be inside their critical section without any writer process. For writer process to go into its critical section, it should check whether there is any reader or writer process is in the critical section.
Critical section in this problem is reading shared data buffer for reader and updating shared data buffer for writer processes. It is up to you to implement any shared data for readers and writers but you have to specify clearly following things in your sample output.
• When reader or writer enters its critical section, it has to report whether there are any reader(s) or writer(s) other than itself.
• You may print out the data you read or write when you implement real buffer. (Optional)
• You have to print out "Panic Messages" when the rules behind this semi critical section problem are not observed.
In your main program, you run the random number generator function to choose process to execute. The chosen process starts (resumes) execution and after one instruction, it will be returned. (You should force each process run exactly one instruction then returns and waiting for its turn).
You can implement this using switch statement in C or C++. Do not use any multi-threading nor mutex feature from programming language. Each process is one big switch statement and will be returned after each instruction. You need to keep track of program counter of each process to resume at the right place once it will be chosen to run by keeping global counter variable per process.
Subproject 1: You should implement binary and counting semaphores.
Subproject 2: You should implement swap operation.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 18:40, brooklyn4932
How does is make you feel when you're kind to others? what are some opportunities in your life to be more kind to your friends and loved ones? imagine a world where kindness has be outlawed. how would people act differently? would your day-to-day life change significantly? why or why not?
Answers: 2
image
Computers and Technology, 24.06.2019 01:00, summerjoiner
Verify each identity[tex] \frac{csc}{cot \: x \: + \: tan \: x} = cos \: x[/tex]
Answers: 1
image
Computers and Technology, 24.06.2019 01:30, jadaroyval
Write a program that asks the user to enter the name of an input file. if the file does not exist, the program should prompt the user to enter the file name again. if the user types quit in any uppercase/lowercase combinations, then the program should exit without any further output.
Answers: 3
image
Computers and Technology, 24.06.2019 14:00, superstarsara5ouh83x
Fast answer i need for apex ! smartphones should be banned from the classroom in public schools so that students cannot cheat on test so easily? which is an example of a counter argument to the thesis above? a. the classroom is a place for learning not for making phone calls b. smartphones are useful learning tools in the modern classroom c. banning smartphones will not students pay attention to teachers any better d. banning smartphones would decreased incidents of theft
Answers: 2
Do you know the correct answer?
7 processes are characterized by 4 readers and 3 writers. Up to three reader processes can be insid...

Questions in other subjects:

Konu
Mathematics, 02.02.2020 15:52
Konu
Biology, 02.02.2020 15:52