Page 56 - DCAP103_Principle of operating system
P. 56
Unit 2: Process Management-I
scheduled to run. Context-switch time is pure overhead, because the system does no useful Notes
work while switching. Its speed varies from machine to machine, depending on the memory
speed, the number of registers that must be copied, and the existence of special instructions
(such as a single instruction to load or store all registers). Typical speeds range from 1 to 1000
microseconds. Context-switch times are highly dependent on hardware support. For instance,
some processors (such as the Sun UltraSPARC) provide multiple sets of registers. A context switch
simply includes changing the pointer to the current register set. Of course, if active processes
exceed register sets, the system resorts to copying register data to and from memory, as before.
Also, the more complex the operating system, the more work must be done during a context
switch. Advanced memory-management techniques may require extra data to be switched
with each context. For instance, the address space of the current process must be preserved as
the space of the next task is prepared for use. How the address space is preserved, and what
amount of work is needed to preserve it, depend on the memory-management method of the
operating system.
Context switching has become such a performance bottleneck that
programmers are using new structures (threads) to avoid it whenever possible.
Self Assessment
Multiple choice questions:
1. PCB = ...................... .
(a) Program Control Block (b) Process Control Block
(c) Process Communication Block (d) None of the above
2. FIFO scheduling is ...................... .
(a) Preemptive Scheduling (b) Non Preemptive Scheduling
(c) Deadline Scheduling (d) Fair share scheduling
3. Switching the CPU to another process requires to save state of the old process and loading
new process state is called as ...................... .
(a) Process Blocking (b) Context Switch
(c) Time Sharing (d) None of the above
4. The state of a process after it encounters an I/O instruction is ...................... .
(a) Ready (b) Blocked/Waiting
(c) Idle (d) Running
2.4 Cooperating Processes
The concurrent processes executing in the operating system may be either independent processes
or cooperating processes. A process is independent if it cannot affect or be affected by the other
processes executing in the system. Clearly, any process that does not share any data (temporary
or persistent) with any other process is independent. On the other hand, a process is cooperating
if it can affect or be affected by the other processes executing in the system. Clearly, any process
that shares data with other processes is a cooperating process.
LOVELY PROFESSIONAL UNIVERSITY 49