In: Computer Science
II. Application 1 and 2 run concurrently. Whenever a timeout interrupt occurs, the kernel switches control between the applications. Show the order of instruction execution, assuming application 1 is currently running. (42 pts)
Application 1 |
Application 2 |
... instruction i (timeout interrupt) instruction i+1 ... instruction k (timeout interrupt) instruction k+1 ... |
instruction 0 ... instruction j (timeout interrupt) instruction j+1 ... |
_______
_______
_______
_______
_______
_______
Required Sequence of Execution:
1) application 1 started and continues execution from instruction 0 to instruction i
instruction i (application 1)
-------------------timeout interruption --------------------------(switching control--application 1 paused)--------------------------
2) instruction 0 (application 2 started)
...........instructions of applications 2 will continue from instruction 0 to instruction j
instruction j (application 2)
-------------------timeout interruption --------------------------(switching control--application 2 paused)--------------------------
3) instruction i+1 (application 1 begins)
...........instructions of applications 1 will continue from instruction i+1 to instruction k
instruction k (application 1)
-------------------timeout interruption --------------------------(switching control--application 1 paused)--------------------------
4) instruction j+1 (application 2 begins)
........application 2 will continues its execution until it completes all its instructions and then it gets terminated
.......application 2 terminated
5) instruction k+1 (application 1 begins)
........application 1 will continues its execution until it completes all its instructions and then it gets terminated
........application 1 terminated
Note: since the number of items required in the question is mentioned as 6 number of items but as the total number of executions is total 5 in number hence their order is as mentioned above.