subject

Consider a Producer-Consumer problem where M Producer threads run simultaneously to fill up a buffer. Then, exactly N Consumer threads will run simultaneously to take all the data out from the buffer. An example of such scenario is a file is striped into M different site. A downloader program starts M producer threads to get these chunks independently. Once M download threads (from a pool of threads) finish producing the items, the N Consumer threads simultaneously scan the data in their own way. Again, note that N out of many possible consumers succeed. Therefore, you cannot assume that only M producers and N consumers are presents. Look at the given program 1PNC. cpp that works for 1 Producer and N Consumer threads. Be sure to run the program first to see how it behaves. You need to extend the program such that it works for all M producers instead of just 1.Add necessary semaphores to the program. However, you will lose points if you add unnecessary Semaphore. To keep things simple, declare the mutexes as semaphores as well. Then test your program to make sure that it is correct. In your submission directory, include a file called Q5.cpp that contains the correct program.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 08:30
On the loan worksheet in cell c9 enter pmt function to calculate the monthly payment for the altamonte springs 2018 facilities loan. ensure that the function returns a positive value and set the reference to cells b5 and b6 as absolute references.
Answers: 2
question
Computers and Technology, 22.06.2019 19:00
Stacy works as blank. the most important soft skill she needs for this role is blank.
Answers: 3
question
Computers and Technology, 22.06.2019 23:20
How can you tell if someone sent you a text message to your email instead of a email
Answers: 1
question
Computers and Technology, 24.06.2019 07:30
Jason is working on a microsoft excel worksheet and he wants to create a print preview shortcut. his teacher asks him to access the customization option to create the new shortcut. which two tabs should jason select to place the print preview shortcut on the worksheet toolbar? a. new tab (custom) and new group (custom) b. new file tab (custom) and new tab (custom) c. new custom group and new command d. new custom tab and new command
Answers: 2
You know the right answer?
Consider a Producer-Consumer problem where M Producer threads run simultaneously to fill up a buffer...
Questions
Questions on the website: 13722360