Consider a single CPU system with two active processes A and

Consider a single CPU system with two active processes A and B. Explain what happens in the following circumstances including any interrupts, system calls, etc., and how they are handled until a process is back to running again Process A needs to read from a file. The running process (lets say A) does a divide by zero. A timer interrupt occurs while B is running.

Solution

Given that 3 scenarios

(a) process A needs to read frm a file

When there is a need of input or output for the current running process, then the process will do its work, mean while CPU will be allocated to other waiting processes, in this scenario CPU is given to process B.

(b) When process executes divide by zero

Based on the language processor results in different manner, before computing the operations it checks the operation type, based on that it returns error message or crash or failure of system.

Divide by zero is undefined and the result of undefined computation or an non halting one is the undefined value.

Divide by zero is not defined on integers, so it should produce by raising by an error or failing to terminate

(C) Timer interruts when proess B is running:

When timer interrupts the running process B, then the process B is taken out from the processing and kept in ready queue for next execution, and CPU given to the next ready process that means A.

Now A will be executing, if A finished it\'s execution then again B will be executed.

 Consider a single CPU system with two active processes A and B. Explain what happens in the following circumstances including any interrupts, system calls, etc

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site