1,561 views
1 votes
1 votes

Consider a process P running on a system with non-preemptive Kernel design. Consider following actions by P :
(i) A blocking system call.
(ii) Servicing a timer interrupt.
(iii) Exit system call.
(iv) Servicing a disk interrupt, that results in another blocked process being marked as ready.
Which of the above actions always result in context-switch of P?

1 Answer

0 votes
0 votes
Option (i) , Option (ii) , Option (iii)

Excerpt from Tannebum book ( Modern operating system ) :

A nonpreemptive scheduling algorithm picks a process to run and then just lets it run until it blocks (either on I/O or waiting for another process) or voluntarily releases the CPU. Even if it runs for many hours, it will not be forcibly suspended. In effect, no scheduling decisions are made during clock interrupts. After clock-interrupt processing has been finished, the process that was running before the interrupt is resumed, unless a higher-priority process was waiting for a now-satisfied timeout .

 

I’ve marked option (ii) considering that scheduler does run on every clock interrupt , but does not schedule any process . Hence , running of scheduler requires a context switch .

An system call will always result in context switch , hence (iii) is also  correct.

As for option ( 4) , cpu can decide not to choose to serivce an IO interrupt . hence that will be false .

.

Related questions

0 votes
0 votes
0 answers
2
kidussss asked Sep 1, 2022
247 views
1. Write clearly the dinning philosopher and reader-writer classical problem of process synchronization
0 votes
0 votes
1 answer
4
jugnu1337 asked Dec 18, 2021
518 views
what is seek system call? can anyone explain?