subject

In this lab you will simulate simple multithreading application with producer and consumer" problem Modify "Producer and Consumer Problem" from lecture note so that it can use all buffer space, not "buffe_size - 1" as in the lecture note. This program should work as follows: 1. The user will run the program and will enter two numbers on the command line. Those numbers will be used for buffer size and counter limit.
2. The main program will then create two separate threads, producer and consumer thread.
3. Producer thread generates a random number through random number generator function and inserts this into buffer and prints the number. Increment counter.
4. Consumer thread goes to the buffer and takes a number in the proper order and prints it out. Increment counter.
5. After counter reaches its limit, both threads should be terminated and return to main.
6. Main program terminates. You can implement this project in any OS environment of your choice, windows, Linux, etc. Also, you can use any programming languages you want but your program and sample run should clearly show implementation of subtasks through separate threads.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 10:50
A911 dispatcher is the sole sender of messages to all police officers. while on patrol, officers communicate with the dispatcher who, in turn, relays messages to other officers. the officers do not communicate directly with one another. this illustrates a network.
Answers: 1
question
Computers and Technology, 22.06.2019 21:00
Ulia is planning to attend the same private four-year college her parents attended. she wants to save at least $18,000 in four years to contribute to her college education. which monthly deposit amounts can julia use to achieve her goal? check all that apply.
Answers: 2
question
Computers and Technology, 23.06.2019 09:30
Which of the following tasks is an audio technician most likely to perform while working on a nature documentary? (select all that apply). eliminating potentially distracting background noise adding sound effects making sure the lighting is adequate for a particular scene changing the narration to better match the mood of the documentary
Answers: 3
question
Computers and Technology, 23.06.2019 15:10
What role did women fill during world war ii?
Answers: 1
You know the right answer?
In this lab you will simulate simple multithreading application with producer and consumer" problem...
Questions
question
Mathematics, 02.09.2021 03:50
question
History, 02.09.2021 03:50
question
Mathematics, 02.09.2021 03:50
question
Mathematics, 02.09.2021 03:50
Questions on the website: 13722367