Show Bid Request
operating
Bid Request Id: 3542
|
|
|
Description:
1 Suppose that Lucy and Ethel have gone to work for the Mizzo candy factory. Mizzo produces two types of candy: crunchy frog bites and everlasting escargot suckers. Unlike their last job, Mizzo has automatic flow control on their assembly line. No more than 10 candies are on the conveyer belt at any given time. Crunchy frog bites tend to be more expensive than escargot suckers, so Mizzo has implemented a policy to prevent putting too many frog bites in the same box. No more than 3 frog bites can be on the line at any given time. (Candies are taken off the line in the order that they are produced.)
Write pseudocode to simulate this multiple producer and consumer problem. Each candy generator should be written as a separate process. The consumer processes (Lucy & Ethel) should share common code.
2 In class, we discussed an algorithm for mutual exclusion using TestAndSetLock. We indicated that this was not a critical region. Show why the algorithm does not implement a critical region. Remember to use the definition of critical region that I gave in class as opposed to Tanenbaum's.
3 Justify the use of threads in an operating system. Next, consider a multithreaded process where one thread has scheduled an input. If the process forks, there are now two threads waiting for input and the operating system must determine how this should be handled. Can this situation ever occur in a single threaded process? Why or why not?
4 Explain context switches and justify why at least portions of context switch code are always written in assembly. Operating system designers are likely to assign some of their best coders to the task of designing the context switch code. Why is this?
5 An adaptive mutex is a semaphore that makes a decision as to whether or not to busy wait depending upon the state of other processes in a multi-processor system. When a process attempts to wait on a semaphore, the following is done (for simplicity, we consider a mutex between two processes only):
wait (Semaphore S) { S.value = S.value - 1; if (S.value < 0) { /* Some other process P holds the semaphore */ P = process in critical region for semaphore S; if (state(P) == running) { while (S.value < 0) /* busy wait */ no-op; } else { add calling process to wait list for S; block calling process; } } }
What is the rationale for providing such a semaphore?
Deliverables: Complete and fully-functional working program(s) in executable form as well as complete source code of all work done.
Special Conditions / Other:
deadline is sunday or monday
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 |
|
|
|
This bid was accepted by the buyer!
|
$100 (USD)
|
Oct 11, 2001 3:09:24 AM EDT
|
10
(Excellent)
|
|
|
An essay and code! Looks simple enough. I'll make sure the style looks like yours :-) |
|
|
|
|
|