Question:
What is Context Switch?
Answer:
Switching the CPU to another process requires saving the state of the old process and loading the saved state for the new process. This task is known as a context switch. Context-switch time is pure overhead, because the system does no useful work while switching. Its speed varies from machine to machine, depending on the memory speed, the number of registers which must be copied, the existed of special instructions(such as a single instruction to load or store all registers). Source: CoolInterview.com
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. Source: CoolInterview.com
Answered by: imran | Date: 2/12/2010
| Contact imran
Selecting a new process from a ready state is called context switching. Source: CoolInterview.com
Answered by: Dinesh | Date: 4/22/2010
| Contact Dinesh
Switching the cpu to another process require saving the state of old processor and loading the saved stack for new process. Its speed typical ranges from 1 to 1000 microseconds. Source: CoolInterview.com
Answered by: mythili | Date: 6/1/2010
| Contact mythili
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|