0% found this document useful (0 votes)
3 views2 pages

Understanding Process Control Blocks and Scheduling

The Process Control Block (PCB) contains the state information needed for each process. It includes the process identifier (PID), user identifier (UID), CPU state like registers and program counter, scheduling information like priority and state, accounting data like memory used and CPU time, and I/O management information like open files. Short-term scheduling uses priority queues, with higher priority queues scheduled before lower ones. New processes enter the highest priority queue, and may move down queues over time based on CPU usage, or up if blocking for I/O. This allows CPU-intensive processes to receive lower priority than I/O-bound ones.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views2 pages

Understanding Process Control Blocks and Scheduling

The Process Control Block (PCB) contains the state information needed for each process. It includes the process identifier (PID), user identifier (UID), CPU state like registers and program counter, scheduling information like priority and state, accounting data like memory used and CPU time, and I/O management information like open files. Short-term scheduling uses priority queues, with higher priority queues scheduled before lower ones. New processes enter the highest priority queue, and may move down queues over time based on CPU usage, or up if blocking for I/O. This allows CPU-intensive processes to receive lower priority than I/O-bound ones.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

3/02/00

Process Control Block (*)


Process Control Block (PCB)
OS data structure which contains the state information for each process
one PCB per process

State information is needed to suspend and correctly resume process execution when another process is scheduled to run
Process Identifier (PID), which identifies process User identifier (UID), which identifies the user owning the process
User identification is passed from parent to child

CPU state
Data registers, Program Counter(PC), Stack Pointer(SP), PSW, MAR, MBR, etc.

Process Scheduling Control


Priority, events pending, process state

Process Accounting Information


PID, UID, amount of memory used, CPU time elapsed, etc. Example: the UNIX ps command information

Memory Management
Location and access state of all user data

I/O Management
Files and devices currently opened Device buffer status 3/02/00 COS214, Roberto Togneri, E&E Eng, Univ. of Western Australia 2.5

Exercise: 1. Check-out UNIX PCB in files /usr/include/sys/{proc.h, user.h} 2. Read man ps and run the ps command to see what accounting state information is kept by the system

COS214, Roberto Togneri, E&E Eng, Univ. of Western Australia

2.5

3/02/00

Short-Term Scheduling Policies(*)


Priority Scheduling (Feedback)
Multi-level ready queues: RQ0, RQ1, RQ2, Different priority scheduling for each queue
If i < j then RQi is a higher priority to RQj RQ0 is highest priority queue

Scheduler selects processes from highest queue which is non-empty


Select next process from RQ0, If RQ0 is empty then select process from RQ1 If RQ1 is empty then select process from RQ2, and so on Processes in a higher priority queue will always be scheduled in favour of processes in lower priority queues

Process priority aging using priority-based RR scheduling


Operation
Each new process is admitted to RQ0 If process runs and times-out it is moved to RQ1 else process blocks before expiry of quantum and is returned to RQ0 upon wakeup As process keeps timing out it is moved down each priority queue If process begins to block before time-out it can be moved up each priority queue

CPU bound process will have lower priority to I/O bound processes
3/02/00 COS214, Roberto Togneri, E&E Eng, Univ. of Western Australia 2.31

Practical use of multi-level priority queues for University machines system processes interactive processes other I/O processes staff processes batch processes student processes (lowest priority) (highest priority)

COS214, Roberto Togneri, E&E Eng, Univ. of Western Australia

2.31

You might also like