CONTEXT SWITCH

A context switch occurs when a computer’s CPU switches from one process or thread to a different process or thread.

Context switching allows for one CPU to handle numerous processes or threads without the need for additional processors.

Any operating system that allows for multitasking relies heavily on the use of context switching to allow different processes to run at the same time.

Typically, there are three situations that a context switch is necessary, as shown below.

Multitasking:

§  When the CPU needs to switch processes in and out of memory, so that more than one process can be running.

Kernel/ User Switch:

§  When switching between user mode to kernel mode, it may be used.

Interrupts:

§  When the CPU is interrupted to return data from a disk read.

Advertisements

Give A message for us

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s