Question: CSCI 3 7 5 Project # 1 Due date: Sep 2 9 , 2 0 2 4 How to submit: Email your source code and

CSCI 375 Project #1
Due date: Sep 29,2024
How to submit: Email your source code and sample result with a proper
explanation of the experiment
In this lab, you will simulate a simple multithreading application with a producer and consumer
problem.
Modify Producer and Consumer Problem from the lecture note so that it can use all buffer
space, not buffersize 1 as in the lecture note. This program should work as follows:
1.2.3. The user will run the program and will enter two numbers on the command line.
Those numbers will be used for buffersize and counter limit.
The main program will then create separate producer and consumer threads.
The Producer thread generates a random number through a random number
generator function, inserts it into the buffer, prints the number, and increment
counter.
4.5. The Consumer thread goes to the buffer, takes a number in the proper order, prints it
out, and increment counter.
After the counter reaches its limit, both threads should be terminated and returned to
the 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 language you want but your program and sample run should
clearly show the implementation of subtasks through separate threads. Do not use any language
or implementation specific mutual exclusion tools like semaphore, mutex, etc. You are
allowed to use only features relative to creating and maintaining threads from the proper
library.
You should not copy from outside sources. Violation of this policy will result in automatic
fail. (You might need to explain your code and result.)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!