Respuesta :

Answer:

For I/O-bound we require voluntary context switches.

For CPU-bound we require non-voluntary context switches.

Explanation:

A voluntary context switches occurs when process has given up control of the CPU because it requires a resource that is currently unavailable(such as blocking for I/O). It happen frequently in normal system operation. Voluntary context switching initiated with a call to the sleep() routine.

A non-voluntary context switches occurs when the CPU has taken away from a process, such as when it's time slice has expired or it has been preempted by a high-priority process. It is forced by direct invocation of the low-level context-switching mechanism embodied in the mi_switch() and setrunnable() routines.

The correct context switches for the two types of programs are as follows:

  • For I/O-bound we require voluntary context switches.
  • For CPU-bound we require non-voluntary context switches.

According to the given question, we are asked to show the correct context switches for the two types of programs, I/O bound and a CPU bound program.

As a result of this, we can see that a voluntary context switch has to do with when a process in the processing unit does not have control because it lacks the proper resource.

On the other hand, a non voluntary context switch has to do with there is lack of control as a result of process allocation or time slice and this occurs in the CPU bound program,

Read more here:

https://brainly.com/question/14704591

ACCESS MORE