Operating System

Q:

When there is a context switch from one process to another, the OS kernel invokes the function
ContextSwitch which saves the context of the currently executing process into its PCB and then
inserts the process to an appropriate queue (i.e., ready queue or a blocked queue). It is necessary that
ContextSwitch is atomic (i.e., unbreakable: either done or not-done; nothing in between). Explain the
following:
a) Why must ContextSwitch be atomic?
b) How can it be made atomic in practice?

January 21st, 2014 12:22am

What does this have to do with CM07?

Is this a question from you homework from school?

Free Windows Admin Tool Kit Click here and download it now
January 21st, 2014 5:39am

I highly recommend you read Windows System Internals by Mark Russinovich. He discusses these concepts.

Ultimately, if a context switch is not atomic, then it could be interrupted by something else (like an interrupt or another request to switch context) which would completely disrupt the in progress context switch making it essentially invalid because the current context would be able to be saved off for later restoration. The how is probably "secret sauce" although Mark does discuss it in the book. 

January 21st, 2014 9:53am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics