Find Jobs
Hire Freelancers

Simple Java Program

$10-30 USD

已完成
已发布超过 9 年前

$10-30 USD

货到付款
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.
项目 ID: 6444211

关于此项目

3提案
远程项目
活跃10 年前

想赚点钱吗?

在Freelancer上竞价的好处

设定您的预算和时间范围
为您的工作获得报酬
简要概述您的提案
免费注册和竞标工作
颁发给:
用户头像
Hi, I would like to do this project please. Let me know if you are interested so I can start. Thanks.
$30 USD 在1天之内
4.9 (1267条评论)
7.8
7.8
3威客以平均价$55 USD来参与此工作竞价
用户头像
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 在0天之内
5.0 (7条评论)
3.9
3.9
用户头像
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 在1天之内
4.7 (4条评论)
2.3
2.3

关于客户

UNITED STATES的国旗
atlanta, United States
5.0
32
付款方式已验证
会员自3月 30, 2014起

客户认证

谢谢!我们已通过电子邮件向您发送了索取免费积分的链接。
发送电子邮件时出现问题。请再试一次。
已注册用户 发布工作总数
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
加载预览
授予地理位置权限。
您的登录会话已过期而且您已经登出,请再次登录。