Find Jobs
Hire Freelancers

Simple Java Program

$10-30 USD

Completed
Posted over 9 years ago

$10-30 USD

Paid on delivery
Multithreading Producer Consumer Assignment Consider the producer/consumer problem using Message objects using a BlockingQueue. Create a class called Message which contains a String attribute to hold a message. Create a Runnable class called Producer that will create 100 messages (use a for loop). Have the Producer use the [login to view URL]() method to vary the time to produce a Message (hint: use the index of the for loop to determine milliseconds to sleep each time through the loop: first time through the loop sleep 0 milliseconds, second time sleep 1 milliseconds, etc.). The Producer will place the messages in a BlockingQueue for the consumer to pick them up. Have the producer send a message containing the String "Exit" to signal that it is done producing. Use appropriate output display announcing the production of each message. Create a Runnable class called Consumer to consume the messages from the producer. Have it get each message from the BlockingQueue The consumer will know when it is done by checking to see if the message content is "Exit". Have the Consumer use the [login to view URL]() method to delay consuming of each message by 10 milliseconds. Use appropriate output display announcing the consuming of each message. Create a test program to test your Producer and Consumer classes. The test program will create a BlockingQueue of size 10 for the producer and consumer to use (BlockingQueue is in the [login to view URL] package). Create and run a producer and consumer thread. What are the results? Increase the consumer sleep time to 100 miliseconds and rerun the test program. What difference did that make? Note: Answer questions by putting the results in a file called Results.txt. Place the [login to view URL] file in the main project folder.
Project ID: 6444211

About the project

3 proposals
Remote project
Active 10 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi, I would like to do this project please. Let me know if you are interested so I can start. Thanks.
$30 USD in 1 day
4.9 (1267 reviews)
7.8
7.8
3 freelancers are bidding on average $55 USD for this job
User Avatar
I am a professional java developer and i can help building this Multithreading class for you. Is this needed asap? I am online right now. Thanks in advance.
$111 USD in 0 day
5.0 (7 reviews)
3.9
3.9
User Avatar
Sir, i can work with java android PHP MYSQL HTML5 wordpress jquery bootstrap. I can do your work and can communicate with ease. So if you give me an opportunity to work with you i will be thankful to you.
$24 USD in 1 day
4.7 (4 reviews)
2.3
2.3

About the client

Flag of UNITED STATES
atlanta, United States
5.0
32
Payment method verified
Member since Mar 30, 2014

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.