subject

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.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:40
State the parts of a variable declaration?
Answers: 2
question
Computers and Technology, 22.06.2019 11:00
Ihave an iphone 8plus should i get another phone like samsung note 9 or s9 ? ?
Answers: 2
question
Computers and Technology, 22.06.2019 12:00
The following function returns a string of length n whose characters are all 'x'. give the order of growth (as a function of n) of the running time. recall that concatenating two strings in java takes time proportional to the sum of their lengths. public static string f(int n) { if (n == 0) return ""; if (n == 1) return "x"; return f(n/2) + f(n - n/2); } options: a) constant b) logarithmic c) linear d) linearithmic e)quadratic f)cubic g) exponential
Answers: 2
question
Computers and Technology, 22.06.2019 19:40
Solve the following javafx application: write a javafx application that analyzes a word. the user would type the word in a text field, and the application provides three buttons for the following: - one button, when clicked, displays the length of the word.- another button, when clicked, displays the number of vowels in the word.- another button, when clicked, displays the number of uppercase letters in the word(use the gridpane or hbox and vbox to organize the gui controls).
Answers: 1
You know the right answer?
7 processes are characterized by 4 readers and 3 writers. Up to three reader processes can be insid...
Questions
question
Mathematics, 15.04.2020 20:36
question
Social Studies, 15.04.2020 20:36
Questions on the website: 13722361