The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+27 votes
3.6k views

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.

asked in Operating System by Veteran (59.7k points)
edited by | 3.6k views
0
@Arjun sir, please answer this

5 Answers

+47 votes
Best answer

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).

answered by Boss (16.7k points)
edited by
+4
but the state of the process is not "BLOCKED" WHEN SCHEDULER GETS INVOKED IT PUSHED BACK THE PROCESS TO THE READY STATE AND MAY PUSH ANOTHER PROCESS TO RUNNING STATE  FROM READY STATE SO NONE OF THESE IS ACCURATE
+25 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.
answered by Loyal (9.4k points)
+2

For C choice, it is like interrupt is taken and what it does after finishing interrupt handler. No need to worry about priority here.

http://stackoverflow.com/questions/4732409/context-switch-in-interrupt-handlers

+5
D seems the most appropriate though..
+1
I can not understand option b and c

Plzzzz provide correct explanation
+2
C) , can be like - what if a higher priority process comes , after servicing of interrupt.
0
If you see process state diagram in os an process can be in blocked state only if it is waiting for an I/O or event so D is not appropriate
0
is the option d like when I/O interrupt arrived then cpu makes the current process to blocked state and service the interupt(which is like a process - another process)
0
Can someone explain option b?
0

@sukannya

Interrupt are the external or internal event of CPU used to handle any particular task. In the operating system, concept interrupts are services or signal used to start and stop any particular task/process.

In this picture, the seller has to handle two interruptions but he is 1st completing the first and then after he is going for next one or 2nd person, so it is not always changed but in next picture 
the manager has high priority than co_worker it doesn't matter who came 1st you have to do work of manager 1st then if possible then co_worker so we not always change the state of the interrupted process but sometimes we change its totally depend upon the process. may change the state of the interrupted process to ‘blocked’ and schedule another process. (option_d)

+8 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
answered by Junior (733 points)
–5 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 ).

answered by Active (2k points)
edited by
–6 votes
ans is  c
answered by Active (3.6k points)
+1
why ?
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

44,252 questions
49,744 answers
164,047 comments
65,842 users