Closed

producerconsumer java project

In this project, you will write a program to simulate producer-consumer problem using bounded buffer whose size is 10. (this means the buffer only can store 10 messages.) For this, there will be one program creating two threads (one for producer and the other for consumer) which act as different processes. After 15 seconds of running, the program (both producer and consumer threads) should be terminated gracefully without any error.

2. Producer Thread Producer thread generates integers (0~14) which are treated as a message. The thread first checks if the buffer is full or not. At this moment, make sure the producer thread always waits random period of time (10~100 milliseconds) before checking the buffer. This is to create randomness in the program execution. If the buffer is full, it waits another random period of time (10~100 milliseconds). If the buffer is not full, then it places an integer (0~14) in sequence into the buffer. “In sequence”, herein, means first the producer places 0 in the buffer. Next time, it produces 1, 2, 3, … and so on until it produces 14 and places it in the buffer. Once the producer places 14 in the buffer, it produces 0 again.

Every time producer thread places a message (and integer) in the buffer, it makes a log in the file (say, [login to view URL]) in the following format (where current time is in millisecond):

Producer “current time”, Placing 0 in the buffer location 0. “current time”, Placing 1 in the buffer location 1. “current time”, Placing 2 in the buffer location 2. … “current time”, Placing 9 in the buffer location 9. “current time”, Placing 10 in the buffer location 0. “current time”, Placing 11 in the buffer location 1. … “current time”, Placing 14 in the buffer location 4. “current time”, Placing 0 in the buffer location 5. “current time”, Placing 1 in the buffer location 6. “current time”, Placing 2 in the buffer location 7. …

3. Consumer Thread Consumer thread consumes integers (messages), 0~14, placed in the buffer by the producer thread. The consumer thread first checks if the buffer is empty or not. At this moment, make sure the consumer thread always waits random period of time (10~100 milliseconds) before checking the buffer. This is to create randomness in the program execution. If the buffer is empty, it waits another random period of time (10~100 milliseconds). If the buffer is not empty, then it takes an integer (message), which is placed in the buffer at the earliest time, from the buffer. (based on the FIFO policy)

Every time consumer thread consumes a message (and integer) from the buffer, it makes a log in the file (say, [login to view URL]) in the following format (where current time is in millisecond):

Consumer “current time”, Consuming 0 from the buffer location 0. “current time”, Consuming 1 from the buffer location 1. “current time”, Consuming 2 from the buffer location 2. … “current time”, Consuming 9 from the buffer location 9. “current time”, Consuming 10 from the buffer location 0. “current time”, Consuming 11 from the buffer location 1. … “current time”, Consuming 14 from the buffer location 4. “current time”, Consuming 0 from the buffer location 5. “current time”, Consuming 1 from the buffer location 6. “current time”, Consuming 2 from the buffer location 7. …

Skills: Java

See more: need freelancer for java project, convert java project maven build, pwm generator java project, producer consumer problem in java using inter thread communication, what is producer consumer problem in java, producer consumer problem c++, producer consumer problem in java using semaphores, multiple producer consumer problem in java, producer consumer problem in os pdf, producer consumer problem in java using wait and notify, producer consumer problem in c, project management, java, sample java project, simple java project code, java project management pdf, configure java project using serverxml tomcat, gis java project, java project school registar, prefuse java project active

About the Employer:
( 0 reviews ) United States

Project ID: #17113977

28 freelancers are bidding on average $20/hour for this job

it2051229

Hi there, I do Java programming and did producer-consumer projects before. I went through your requirements and I would like to do this project if given the opportunity. Let me know if you are interested. Thanks.

$22 USD / hour
(1024 Reviews)
7.6
liangjongai

Hello! I'm interesting your project very well. I am a full time devloper. I am great skill in java. My price and period is negotiable. Employee’s satisfy is my happiness ! Let's go ahead with me !

$22 USD / hour
(221 Reviews)
7.1
$25 USD / hour
(258 Reviews)
6.6
abhijitbuet

I am a multi-threading expert in Java. I have completed Producer-Consumer problem numerous times. So I can do it for you as well.

$25 USD / hour
(225 Reviews)
6.7
Colaninfotech

# Senior Java experts with 10+ years’ experience# Hello there, This is Shree from Colan. We noticed that you are looking for an java experts to write the program simulate producer-consumer with all the modules wh More

$18 USD / hour
(13 Reviews)
6.6
hbxfnzwpf

I am very proficient in java. I have 16 years java developing experience now, and have worked for more than 7 years. My work is online game developing, and mainly focus on server side, using java under Linux environmen More

$15 USD / hour
(53 Reviews)
6.2
$16 USD / hour
(91 Reviews)
5.6
paulprabhakarand

Hi, I am a tech savvy person, more than a decade I am developing and delivering applications on Java based technologies. I am a certified Java professional. My logical thinking and problem solving skills are quite go More

$16 USD / hour
(19 Reviews)
5.1
nittilegupta

Hello, I have read the project description and understood your requirement to write a Java program to simulate producer-consumer problem using bounded buffer whose size is 10. I can certainly get this job done a More

$15 USD / hour
(10 Reviews)
4.9
panjvirsingh

I would like to offer myself as a probable candidate for this assignment as I am confident of delivering a quality output. I have excellent expertise in this area. I have total 7 years or experience in web developme More

$22 USD / hour
(17 Reviews)
4.2
$22 USD / hour
(23 Reviews)
4.4
omoretech

Hi, I have great experience in Java development, hands on experience in Java Threading including Multi-threading, thread synchronization, thread scheduling etc I recently work on same program using consumer and produc More

$17 USD / hour
(10 Reviews)
4.1
$22 USD / hour
(20 Reviews)
4.2
kaloyan13

I have done programs, which use the boundedd buffer model of communication. Parallel programming is my special skill.

$27 USD / hour
(19 Reviews)
4.0
sat2017912

Have an idea or project you are working on and ready to implement it right now? Have you wasted time with other developers who have not delivered? Well, you don't have to worry about that any more...

$22 USD / hour
(11 Reviews)
3.6
$22 USD / hour
(12 Reviews)
3.8
wuricheng1985

Hi! I am a Java expert and have 7 years of experience with Java. I can do two thread processing in Java and can get this developed for you quickly! If you hire me, I will give you excellent results with a small am More

$16 USD / hour
(1 Review)
1.7
ashamansky

Hello, I can implement such project for you using Java 8-9. It's similar to threadpool executors. The only one mention that for random wait will be better to use nanos, because regular sleep is depend to CPU perform More

$22 USD / hour
(2 Reviews)
1.7
$16 USD / hour
(1 Review)
1.3
bphaneesh

Heyo! I see you're a student and you need to get your assignments solved. If you want this regularly then let me know, we can work out the pricing accordingly. Otherwise, I can solve this one for a fixed price. Fe More

$25 USD / hour
(0 Reviews)
0.0