Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1.What is happening in the computer and/or OS during a context switch? 2.What mi

ID: 3789689 • Letter: 1

Question

1.What is happening in the computer and/or OS during a context switch?

2.What might be the value of interprocess communication (IPC)?

3.Is sharing a resource such as a common set of data considered IPC? Why or Why Not?

4.What makes message passing block or non-blocking?

5.What makes either one of these operations synchronous or non-synchronous?

6.What important part of the process switch operation is not shown in Figure 3.4?

process Po operating system process P interrupt or system call executing save state into PCBo idle reload state from PCB1 dle interrupt or system call executing save state into PCB1 idle reload state from PCB0 executing Figure 3.4 Diagram showing CPU switch from process to process.

Explanation / Answer

1] Context Switch:i]A context switch is also known as a process switch or task switch.It is the switching of CPU from one process or thread to another.

ii]A process or task is an executing instance of a program.

ii]Context switching occurs for a variety of reasons i.e because of Operating System function has been called,the application has been preempted and the time slice has been expired for one process & a new process to be loaded from the ready queue.Context switch involves storing the old state and retriving the new state.

2]i]Interprocess Communication is a mechanism that allow the exchange of data between processes.This allow a program to handle many user request at same time.

ii]The method that divided into different categories for achiving IPC are based on software requirements such as performance and modularity requirements & system circumstance such as network bandwidth and lantency.

iii] IPC is mostly used to design process for microkernels and nanokernels.

3]Yes, Sharing a resource such as common set of data is considered as IPC .Because in IPC it has a mechnism that allow the exchange of data between process.

4]Message passing : It is form of communication used in parallel programming and object oriented programming.Communication is completed by sending a messagei.e. signals ,functions or data packets to receipient.

*Message passing primitives:

i]Message passing Block;

*Send:Returns control to the user only after msg has been sent.

*receive:Returns only after msg has been received.

*problem is it reduce concurrency.

ii}Message passing non-blocking:

*send:Returns control as soon as msg queued.

*receive:Signals willingness to receive message .Buffer is ready.

*probles are need buffering and tricky to program.