subject

Implement a solution to the producer consumer problem with the following settings (write c++ code):
there are three producers all in infinite while loops each producing 1 item in one loop.
there are three consumers all in infinite while loops each consuming 1 item in one loop.
every consumer or producer yields at the end of a loop to the next process
consider that the buffer size is 6 items.
consider that in your ready queue there are three consumers then seven producers then 7 consumers and finally three more producers .
run the code for infinitely long.
at the end of each loop before yield the consumer should print the following:
if consumer x is consuming an item then print
"this is consumer x consuming item generated by producer y"
else print
"consumer x is waiting"
at the end of each loop before yield the producer should print the following: if producer x is producing an item then print
"this is producing x producing item number y"
else print
"producer x is waiting"

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 00:30
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
question
Computers and Technology, 23.06.2019 21:00
Alcohol’s affects on the cornea and lens of the eye make it more difficult
Answers: 1
question
Computers and Technology, 24.06.2019 08:20
Evaluate the scenario below and indicate how to handle the matter appropriately. situation: michael received an e-mail from what he thought was his doctor’s office, requesting his social security number. since he had just been in to see his doctor last week, he replied to the e-mail with his social security number.
Answers: 2
question
Computers and Technology, 24.06.2019 09:30
Retype the statements, correcting the syntax errors. system.out.println("num: " + songnum); system.out.println(int songnum); system.out.println(songnum " songs"); note: these activities may test code with different test values. this activity will perform two tests: the first with songnum = 5, the second with songnum = 9. see how to use zybooks.
Answers: 1
You know the right answer?
Implement a solution to the producer consumer problem with the following settings (write c++ code):...
Questions
question
Mathematics, 04.03.2021 21:20
question
Mathematics, 04.03.2021 21:20
question
Law, 04.03.2021 21:20
question
History, 04.03.2021 21:20
question
Mathematics, 04.03.2021 21:20
Questions on the website: 13722360