edited by
13,752 views
48 votes
48 votes

When an interrupt occurs, an operating system

  1. ignores the interrupt

  2. always changes state of interrupted process after processing the interrupt

  3. always resumes execution of interrupted process after processing the interrupt

  4. may change state of interrupted process to ‘blocked’ and schedule another process.

edited by

4 Answers

Best answer
91 votes
91 votes

Think about this:
When a process is running and after time slot is over, who schedules new process?
- Scheduler.

But to run "scheduler" itself, we have to first schedule scheduler.
This is catch here, We need hardware support to schedule scheduler. That is hardware timer. When timer expires, then hardware generates interrupt and scheduler gets schedule.
Now after servicing that interrupt, schedular may schedule another process.

This was about Hardware interrupt.

Now think if user invokes a system call, System call in effect leads to interrupt, and after this interrupt CPU resumes execution of current running process,

Conclusion: Its about type of interrupt being serviced.
Options with "always" are false.

Hence, option (D).

edited by
35 votes
35 votes
A. Depends on the priority.
B. Not always.
C. Not always. If some high priority interrupt comes during execution of current interrupt, then?
D. Seems to be correct.
12 votes
12 votes
Whether the interrupted process will complete execution or some other process would execute is decided by the process scheduler.

For instance if the interrupt signaled an IO completion event,that caused a high priority process to transition from blocked to ready state, the OS might preempt the interrupted process and dispatch the high priority process.
Hence answer is D.

Source: Harvey M. Deitel
–4 votes
–4 votes

I think C is most appropriate , because There is a flag called IEN  ( Interrupt enable ) Flag which is set to 1 when an interrupt arrives .

but as soon as you serviced the interrupt , and when the  contents of interrupted process are restored till that time IEN is disabled so that no other interrupts can arrived or set the IEN flag . 

As soon as the restoring is done , interrupted process is executed and then ( IEN  is enabled ) so  it may happen that happen that another higher priority interrupt . But if you see there may be small time  but it is always case that interrupted process will be excuted ( may be for very short time if higher ones come ).

edited by
Answer:

Related questions

50 votes
50 votes
13 answers
1
32 votes
32 votes
2 answers
2
Kathleen asked Sep 29, 2014
8,512 views
I/O redirectionimplies changing the name of a filecan be employed to use an existing file as input file for a programimplies connecting $2$ programs through a pipeNone of...
24 votes
24 votes
3 answers
3
Kathleen asked Sep 29, 2014
5,632 views
The correct matching for the following pairs is:$$\small \begin{array}{cl|cl}\hline \text{(A)} &\text{Disk Scheduling} & \text{(1)} &\text{Round robin} \\\hline \text{...