Question 41
Question 42
P1 P2 if (a < 0) b = 10; c = b-a; a = -3; else c = b+a;If the processes P1 and P2 executes concurrently (shared variables a, b and c), which of the following cannot be the value of ‘c’ after both processes complete?
Question 43
Question 44
Question 45
Shared Data mutex:semaphore = 1:/* initialized to 1*/ process[3]:semaphore = 0; /*all initialized to 0 */ R_requested [3]:boolean = false; /*all initialized to false */ busy: boolean = false; /*initialized to false */
Code for processes begin process my-priority:integer; my-priority:=____; /*in the range 1...3*/ repeat request_R(my-priority); P (proceed [my-priority]); {use shared resource R} release_R (my-priority); forever end process;
Procedures procedure request_R(priority); P(mutex); if busy = true then R_requested [priority]:=true; else begin V(proceed [priority]); busy:=true; end V(mutex);Give the pseudo code for the procedure release_R.
Question 48
I. Program Counter II. Stack III. Registers IV. Address space
Question 49
Question 50
There are 115 questions to complete.