Show Bid Request
project
Bid Request Id: 6142
|
|
|
Posted by: |
Ycruz12 (2 ratings)
(Software buyer rating 10)
|
Non-action Ratio: |
Very Good - 0.00%
|
Buyer Security Verifications: |
Good
|
Approved on: |
Dec 6, 2001 8:03:38 PM EDT
|
Bidding Closes: |
Dec 10, 2001 8:04:27 PM EDT
|
Viewed (by coders): |
622 times
|
|
|
|
Description:
You may choose to implement your programs eighter in UNIX or Windows (NT/2000) environment.
(30 points) Implement a C or C++ program that takes two command line arguments, double values A and B, computes and outputs How many iterations of A = sin(A + sin(B)) are required before the value of A converges to within 10-15. How many iterations of A = cos(A + cos(B)) are required before the value of A converges to within 10-15. a line stating which of the two equations took fewer iterations to converge. you are required to invoke two child processes to solve this problem:
one child to calculate (but not print) the number of iterations that the sin formula takes. And then sends that result to the other child process, the other child to calculate and print the number of iterations that the cos formula takes, and receive the result from the first child process, print it, and compare the two values. (So the parent process ends up doing very little, other than settings things up, spawning the child processes, and waiting for them to die.)
Use fork to spawn the child processes. You are free to choose the means of communication to pass that value from the first child to the second child.
(30 points) Write a program than does the same as part 1, except that you are required use threads rather than fork'ed processes. In addition to the main thread, create two additional threads:
one to calculate (but not print) the number of iterations that the sin formula takes. And then make that result available to the other thread, the other to calculate and print the number of iterations that the cos formula takes, and receive the result from the first thread, print it, and compare the two values. (So the main thread ends up doing very little, other than settings things up, spawning the two threads, and waiting for them to die.)
Use shared variables as the means of communication between the threads. (Hint: You don't need pipe.) Also, since the two threads are started at the same time, and the second needs to know when the data from the first is available, some form of synchronization is required. You may do this using semaphores. (For example: have the main thread lock the semaphore before it calls the two threads, have the first thread unlock it when the data is ready, and have the second thread lock it as it starts.)
(30 points) Implement a solutions for the bounded-buffer producer/consumer problem. Your implementation sh
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done. Complete copyrights to all work purchased.
Special Conditions / Other:
12-9-01
Remember that contacting the other party outside of the site (by email, phone, etc.) on all business projects < $500 (before the buyer's money is escrowed) is a violation of both the software buyer and seller agreements.
We monitor all site activity for such violations and can instantly expel transgressers on the spot, so we thank you in advance for your cooperation.
If you notice a violation please help out the site and report it. Thanks for your help.
|
|
Bidding/Comments:
|
All monetary amounts on the site are in United States dollars.
Rent a Coder is a closed auction, so coders can only see their own bids and comments. Buyers can view every posting made on their bid requests. |
See all rejected bids (and all comments)
Name |
Bid Amount |
Date |
Coder Rating |
|
|
|
$35 (USD)
|
Dec 7, 2001 5:23:56 AM EDT
|
9.83
(Excellent)
|
|
|
This is very easy task. I've already done the same problem. I'll do it in a day. |
|
|
|
|
|