Suppose the hypothetical processor of Figure below also has two I/O instructions:
0001 - Local AC from Memory
0010 - Store AC to Memory
0101 - Add to AC from Memory
0111 – Subtract Memory from AC
1001 - Load AC from I/O Device
1010 - Store AC to I/O Device
See figure image: See image.
In these cases, the 12-bit address identifies a particular external device.
Show the program execution (using the format of Figure 1.4 in the next page) for the following program:
Assume that the next value retrieved from device A is 4 and that location 941 contains a value of 3. see image.
Assume that at time 5 no system resources are being used except for the processor and memory. Now consider the following events:
Time Event
5 P1 executes a command to read from disk unit 3
15 P5’s time slice expires
18 P3 executes a command to read from disk unit 2
20 P7 executes a command to write to disk unit 3
24 P5 executes a command to write to disk unit 3
28 P5 is swapped out
33 An interrupt occurs from disk unit 3: P1’s read is complete
36 An interrupt occurs from disk unit 2: P3’s read is complete
38 P8 terminates
40 An interrupt occurs from disk unit 3: P5’s write is complete
44 P5 is swapped back in
48 An interrupt occurs from disk unit 3: P7’s write is complete
For each time identify which state each process is in. If a process is blocked, further identify the event on which is it blocked.
If a process exits and there are still threads of that process running, will they continue to run?
Figure 3.9a below contains six states. In principle, one could draw a transition between two states, for a total of 14 different possible transitions (not all showing below).
See figure image. See image.