Skip to main content

Context switching; distributed vs network OS

Short answer

Context switching saves the state of one process/thread and loads another’s, occurring on each node during scheduling or remote calls. A distributed OS offers a single system image with global resource management and transparency, while a network OS exposes multiple independent machines and requires users to know locations.

What do you mean by Context Switching in distributed system? How is distributed OS different from network OS?

Context switching in a distributed system

Context switching is the saving of the state (registers, program counter, stack pointer, memory map) of the running process or thread and loading of the state of another one, so that the CPU is shared. In a distributed system it occurs on each node whenever the scheduler changes the process, and when a process blocks on a remote call (RPC/RMI) or a message. Entering the kernel through a system call needs a cheaper mode switch between user mode and kernel mode.

  • Process context switches are costly (address space, caches, TLB), thread switches are cheaper, which is why multithreaded servers are used.
  • Process migration also needs the context to be transferred to another machine.
  • The overhead should be reduced by threads, lightweight IPC and a microkernel.

Distributed OS versus network OS

PointDistributed OSNetwork OS
ViewSingle system imageCollection of separate computers
TransparencyHighLow; users know the location
Resource managementGlobal, by the OSLocal on each node
Process placementOS decides, may migrateUser chooses the machine
OS on nodesSame (homogeneous)May differ
CommunicationMessage passing/RPC built inFile transfer, remote login via services
Fault toleranceBetterDepends on user
ExamplesAmoeba, MachWindows Server, UNIX + NFS

✓ Answer checked by Claude Opus 5.5 (high effort)

All Distributed System chapter 3 questions →