Unformatted text preview: y the Filter process?
Maximum unprocessed characters produced: _______20______
(B) (4 points) What are appropriate initial values for each of the semaphores?
initial value for charsA: ________0______
initial value for spaceA: _______20______
initial value for charsB: ________0______
initial value for spaceB: ________1______ 6.004 Spring 2010 - 3 of 4 - Quiz #5 (C) (4 points) For each of the following lines of code, indicate whether you would expect to find
them in the Producer process, the Consumer process, or Neither process:
in = (in+1)%20; in process (circle one): P C Neither signal(charsA); in process (circle one): P C Neither signal(indata); in process (circle one): P C Neither wait(charsB); in process (circle one): P C Neither (D) (3 points) Assuming that the only process synchronization appearing in the Producer and
Consumer processes is the use of the four semaphores shown, will the above implementation
work with multiple Producer processes? Multiple Filter processes? Multiple Consumer
processes? “Work” means each character produced by a Producer is translated by exactly
one Filter process and then consumed by exactly one Consumer process, i.e., no character is
lost or processed twice.
Works with multiple Producers (circle one): YES NO Works with multiple Filters (circle one): YES NO Works with multiple Consumers (circle one): YES NO END OF QUIZ! 6.004 Spring 2010 - 4 of 4 - Quiz #5...
View Full Document
- Spring '13
- producer, Executive producer, RF stage, filter process