Question:
CPU, context switching?
2008-04-30 11:40:12 UTC
I am stuck on another practice exam question. The question is:
Define the term ‘context switch’. Describe the circumstances when one could occur and the actions carried out by the Operating System during
a context switch.
[12 marks)

I have managed to find an easy definition of contect switching but i am not too sure when one could occur and the actions carried out by the operating system.
Cheers in advance for the help.
Five answers:
Phreak
2008-04-30 11:57:17 UTC
a context switch is switching the running process out of the processor and switching in another one... when a process exceeds its quanta
JimKata
2008-04-30 11:59:32 UTC
This will be fairly basic. A single core CPU can only serve one program at a time. In the days before windows on PCs, you could only run one program. When you wanted to run another program you had exit the one program and start the other one. With a multi-tasking operating system such a windows NT and above, Linux, and MAC OX/10, there is a process called context switching that lets multiple program share the CPU. When the operating system decides to give the processor to a different program it will tell program A to pause and tell Program B to run. The process of switch the CPU between program A and program B is the context switch.



Hope this helps.
2008-04-30 11:55:37 UTC
Most of the time context switching happens in a multi-threaded environment where different thread simultaneously require to access the CPU. The context switch occurs when you stop one thread to let the other do its work. When you do so, if I recall well, it copy the stuff from the local CPU registries. When the context returns to this thread, the CPU registries are "re-set" with the old value so that the computation can continue.
?
2016-10-06 14:43:12 UTC
by using fact it takes time far off from processing the job(s) handy. as an occasion, if there is actually one job working, the processor can supply it one hundred% of its processing time. there is not any overhead of context switching. If there are 2 initiatives to be run concurrently by way of giving them commerce equivalent time slices, then in theory each and each job could acquire 50% of the processing time. yet to change initiatives, the processor has to keep the present state of the working job, then bear in mind the state wherein it left the different job, and then resume working the different job. it particularly is termed context switching and takes the countless processor time. So each and each job gets decrease than 50% of the processor's time. If each and each job gets 40 5% of the processor's time, then the relax 10% is the overhead ate up by way of context switching. if your actual question is why is it referred to as overhead, fairly of "time wasted by way of managers", that's by using fact the managers have greater means than the grunts...
lynn
2015-03-24 21:52:21 UTC
very confusing problem. browse using google or bing. this will help!


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...