Page 52 - DCAP103_Principle of operating system
P. 52
Unit 2: Process Management-I
Notes
Figure 2.3: Diagram Showing CPU Switch from Process to Process
Operating system
Process P 0 Process P 1
Interrupt a’ system call
Executing
Save state into PCB,
Idle
Reload state from PCB,
Idle Executing
Interrupt a’ system call
Save state into PCB,
Idle
Reload state from PCBO
Executing
Accounting information: This information includes the amount of CPU and real time used,
time limits, account numbers, job or process numbers, and so on.
Status information: The information includes the list of I/O devices allocated to this process,
a list of open files, and so on. The PCB simply serves as the repository for any information that
may vary from process to process.
Threads: The process model discussed so far has implied that a process is a
program that performs a single thread of execution. For example, if a process
is running a word-processor program, a single thread of instructions is being
executed. This single thread of control allows the process to perform only
one task at one time.
2.3 Process Scheduling
The objective of multiprogramming is to have some process running at all times, so as to
maximize CPU utilization. The objective of time-sharing is to switch the CPU among processes
so frequently that users can interact with each program while it is running. A uniprocessor
system can have only one running process.
If more processes exist, the rest must wait until the CPU is free and can be rescheduled.
LOVELY PROFESSIONAL UNIVERSITY 45