answersLogoWhite

0


Best Answer

Context switching is, as far as I know, essentially the same process in all multi-tasking operating systems.

Simplistically, in order for a multi-tasking operating system to switch tasks on and off a CPU, the operating system must be able to store and restore the state of the CPU for each process that shares that CPU. The act of storing and restoring the CPU state is referred to as context switching.

In a nutshell (an oversimplified nutshell), the states/values of the Instruction Pointer, the registers, accumulator etc. must all be saved for a given process for the OS (Operating System) to move to the next process in the queue. Once they are saved, the states/values of the next process in the queue can be loaded into those same registers etc. and that process can continue execution for 'N' number of instructions. Then this whole procedure is repeated for the next process in the queue. And so on, and so forth, ad infinitum...

Necessarily, MUCH is omitted in the above over simplification but it is hoped, none the less, that the above description provides some very general idea of what happens during a context switch.

The term context switching is a sort of catch all which may refer to and cover a number of more specific processes such as thread context switches, register context switches, task context switches etc.

This answer is necessarily over simplified as a full description of context switching is far beyond the scope deemed acceptable in this forum.

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the context switch in UNIX?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Does a privileged instruction involves a Context Switch in Unix?

In any environment, in order to execute a privileged instruction you have have to switch from user mode to kernel mode, hence a context switch.


What is the purpose of -a in unix?

This includes the presence of a switch or option - in this case the 'a' option. Every command in Unix is free to interpret what they means differently as there is no universal meaning for this switch.


What are user level threads?

•No special support needed from the kernel (use any Unix) •Thread creation and context switch are fast (no syscall) •Defines its own thread model and scheduling policies


What does levtty mean?

Some context might help. The closest thing I can think of is /dev/tty, which is a unix-style device name (in unix, printers, terminals, and the like are treated as files).


How do you switch users in Unix?

A user may switch their identities when logged in using the 'su' command. On some systems the 'su' command may be restricted.


The actions taken by a kernel to context switch bet user levl thread?

When a context switch occurs, the kernel saves the context of the old process into its Program Control Block and loads the saved context of the new process scheduled to run.


Describe the actions of a context switch if the new context is already loaded into one of the register sets.?

If the new context is already loaded into one of the register sets, a context switch involves simply changing the pointer to the register set in use. This is a faster operation as no actual data needs to be moved between memory and registers, resulting in a quicker context switch process.


What does the -m switch do with the useradd command?

There are many variations of the useradd command; most standard installations may not have this switch. Please identify which Unix system you are talking about.


How can you minimize idle time in context switch?

If the process that gets the control can be put into the register (its kept in cache though) means less time to fetch and have a context switch. Any way the context switching time isn't a big time delay.


What is difference between select Case statement and nested loop in c programming in UNIX?

UNIX has no bearing on the C language; it is cross-platform. There is no select/case in C, you probably meant switch/case. However, a switch/case is a conditional jump while a nested loop is a loop within a loop. Besides the C language they have nothing in common with each other.


In computing what is the purpose of a context switch?

Context switching allows for a computer to multitask. It can suspend one process in order to switch over and run another process. The first process can be brought back up by suspending the second one.


What is uucp?

UUCP is the abbriviation of Unix to Unix copy. It is worldwide email system called UUCP or Unix to Unix copy.This email system was developed for the operating system called Unix.