0% found this document useful (0 votes)
10 views10 pages

Group 3 Operating System

The document discusses process scheduling in operating systems, detailing its core functions, objectives, types of schedulers, and scheduling queues. It explains the importance of managing CPU utilization, throughput, and response time, while also outlining various scheduling algorithms and the flow of processes between different queues. Additionally, it contrasts the Two-State Process Model with the more efficient Five-State Model for better process management.

Uploaded by

ntungirerhea
Copyright
© All Rights Reserved
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)
10 views10 pages

Group 3 Operating System

The document discusses process scheduling in operating systems, detailing its core functions, objectives, types of schedulers, and scheduling queues. It explains the importance of managing CPU utilization, throughput, and response time, while also outlining various scheduling algorithms and the flow of processes between different queues. Additionally, it contrasts the Two-State Process Model with the more efficient Five-State Model for better process management.

Uploaded by

ntungirerhea
Copyright
© All Rights Reserved
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

P.

O BOX 160, KISORO, UGANDA

METROPOLITAN Kamonyi, Northen Division, Kisoro Municipality

Direct Tel: +256 701 650 111

INTERNATIONAL UNIVERSITY Reception Line: +256 393 208 273

Mobile Line: +256 772 561 957

Email admissions@[Link]

us@[Link]

website: [Link]

COURSE UNIT: OPERATING SYSTEMS GROUP 3

LECTURER: DR JILL MAGRET NATUKUNDA

GROUP MEMBERS.
No. NAME [Link] SIGN.
1. ALIBOSIT JOHN ROBERT 25/BIT/128/UMC
2. AYEBALE BRIAN 25/BCS/081/UMC
3. BAGUMA STEVEN 25/BIT/199/UMC
4. BAMEKA PIUS YESERI 25/BIT/190/UMC
5. BUGALA JOEL 25/BIT/265/UMC
6. GGAYI KELLY 25/BIT/010/UMC
7. GIIBWA HARRIET 25/BIT/274/UMC
8. JAMAL MUDDATHIR 25/BIT/084/UMC
9. KIRABO MARK 25/BIT/081/UMC
10. KISEKA IVAN 25/BCS/061/UMC
11. MAGANDA RAMATHAN 25/BIT/311/UMC
12. MAKASA ALISON KAZIRO 25/BIT/216/UMC
13. MUTANDA ALLAN 25/BIT/273/UMC
14. MUTYABA FAHIM 25/BIT/306/UMC
15. MUWANGUZI DAVIS 25/BWE/021/UMC
16. NAHABWE MORIS 25/BIT/316/UMC
17. NAMUMBYA SHEILA 25/BBC/010/UMC
18. NDAGIRE HARRIET 25/BIT/275/UMC
19. NGANDA MUZAFALU DISAL 25/BIT/198/UMC
20. NSEKUYE TIMOTHY 25/BBC/018/UMC
21. NTALE EDDY 25/BIT/055/UMC
22. NUWAGABA OSBERT 25/BIT/125/UMC
23. OKIRIA SYLAS JULIUS 25/BIT/349/UMC
24. SSEBUGGWAWO OURUMA 25/BIT/208/UMC
DENIS
25. SSEJJEMBA ANDREW 25/BIT/266/UMC
26. SSENTONGO EMMANUEL 25/BWE/008/UMC
27. SSIMBWA CHRISTOPHER 25/BCS/064/UMC
28. TALITOLA BENARD 25/BSE/016/UMC
29. TENDO ELIJAH PAYAGO 25/BIT/077/UMC
30. WEMBABAZI JOEL 25/BIT/295/UMC

QUESTION

DISCUSS THE
1. PROCESS SCHEDULING
2. PROCESS SCHEDULING QEUES
3. TWO STEPPROCESS MODLE
TOPIC; PROCESS SCHEDULING, PROCESS SCHEDULING CHEWS, TWO STAGE
PROCESS SCHEDULING

Process scheduling is a core function of an operating system (OS) that manages the
execution of various processes by determining which process runs on the CPU and for
how long. In multiprogramming environments, it ensures that the CPU remains busy at
all times to maximize efficiency.

Key Objectives of Process Scheduling


Schedulers aim to optimize system performance based on several criteria:
 CPU Utilization: Keeping the CPU as busy as possible (ideally 100%).

 Throughput: Maximizing the number of processes completed per unit of time.

 Turnaround Time: Minimizing the total time from process submission to completion.

 Waiting Time: Reducing the time a process spends waiting in the ready queue.

 Response Time: Minimizing the time between a request and the first response
produced.

Types of Schedulers
Operating systems typically use three levels of schedulers to manage processes at
different timescales:
 Long-Term Scheduler (Job Scheduler): Determines which programs are admitted
to the system for processing and loads them into memory. It controls the degree of
multiprogramming.

 Short-Term Scheduler (CPU Scheduler): Selects a process from the "Ready" queue
to be executed by the CPU. It is the fastest and most frequently invoked scheduler.
Medium-Term Scheduler: Manages swapping by temporarily removing processes
from main memory to secondary storage (disk) to free up resources, reducing the
degree of multiprogramming.

Scheduling Queues
Processes move between several queues as they change states:
 Job Queue: Contains all processes in the system.

 Ready Queue: Holds processes that are in main memory and ready for execution.

 Device Queues: Contains processes waiting for a specific I/O device.

Scheduling Categories
Scheduling algorithms generally fall into two categories:
 Preemptive: The OS can forcibly interrupt a running process to allocate the CPU to
another task, often based on priority or a time limit (quantum).

 Non-Preemptive: Once a process starts, it holds the CPU until it completes or


voluntarily enters a waiting state.

Common Scheduling Algorithms


 First-Come, First-Served (FCFS): Processes are executed in the order they arrive. It
is simple but can lead to the "convoy effect" where short jobs wait behind very long
ones.

 Shortest Job First (SJF): Chooses the process with the smallest execution (burst)
time. This minimizes average waiting time.

 Round Robin (RR): Each process is given a fixed time slice (quantum). If it doesn't
finish, it is moved to the back of the ready queue.

 Priority Scheduling: Processes are assigned priority levels; the CPU is given to the
process with the highest priority.
 Multilevel Queue Scheduling: Partitions the ready queue into several separate
queues (e.g., foreground and background) with different priorities.

Context Switching
When the scheduler switches the CPU from one process to another, it performs
a context switch. This involves:
1. Saving the current state of the running process into its Process Control Block (PCB).

2. Loading the saved state of the next process from its PCB to resume execution.
This process is considered overhead because the system does no "useful" work during
the switch.

PROCESS SCHEDULING QUEUES

Scheduling queues are data structures used by the operating system to manage
processes in different states of execution.

The three primary types of scheduling queues are:


1. Job Queue
 What it is: This queue contains all processes currently in the system, including those
not yet in main memory.

 Location: Typically resides on secondary storage (disk).

 Role: It acts as a holding area for all submitted jobs. The Long-Term
Scheduler selects processes from here to be admitted into the system for execution.

2. Ready Queue
 What it is: This queue holds all processes that are residing in main memory and
are ready and waiting to execute.

 Location: Resides in the main memory.


 Role: The Short-Term Scheduler (CPU Scheduler) selects the next process to run
from this queue based on a specific scheduling algorithm like First-Come, First-Served
(FCFS) or Round Robin.

3. Device Queues (Waiting Queues)


 What it is: These queues contain processes that are blocked because they are waiting
for a specific I/O device or external event.

 Structure: Each I/O device (such as a disk, printer, or keyboard) typically has its own
separate device queue.

 Role: When a running process makes an I/O request, it is moved from the CPU to the
appropriate device queue. Once the I/O operation is complete, the process is moved
back to the Ready Queue to wait for its next turn on the CPU.

Flow of Processes between Queues


1. New Arrival: A process enters the Job Queue

2. Admission: The Long-Term Scheduler moves it to the Ready Queue.

3. Execution: The Short-Term Scheduler selects it from the Ready Queue for the CPU.

4. Interruption/Waiting:

1. If it needs I/O, it moves to a Device Queue.

2. If its time slice expires or it is preempted, it returns to the Ready Queue.

5. Termination: Once finished, it is removed from all queues


DIAGRAM TO SHOW THE PROCESS SCHDULING QUEUES
THE TWO STAGE PROCESS MODLE

Two-Step Process Model, It simplifies process management into two primary


states: Running and Not Running.

Here is a detailed breakdown of the model:


1. The Two States
 Running: This state represents the process currently being executed by the CPU. At
any given moment on a single-processor system, only one process can be in this state.

 Not Running: This state includes all processes that are currently in the system but are
not being executed. These processes are stored in a queue (the Ready Queue),
waiting for their turn to use the CPU.

2. The Role of the Dispatcher


The "Two-Step" aspect refers to how the OS moves processes between these two
states. This is managed by a module called the Dispatcher:
1. Step 1: Interrupt/Halt: A running process is either finished or interrupted (e.g., its
time slice expires). The OS moves it out of the "Running" state and, if it hasn't finished,
puts it back into the "Not Running" queue.

2. Step 2: Dispatch: The OS selects the next process from the "Not Running" queue
based on a scheduling algorithm and moves it into the "Running" state.

3. Why this Model is "Simplified"


While easy to understand, the Two-State model has a significant flaw: it assumes all
"Not Running" processes are ready to execute. In reality, as shown in your image, some
processes are Waiting for I/O (like a Disk or Network request).
In the Two-State model, if a process in the "Not Running" queue is waiting for I/O, the
dispatcher might mistakenly pick it to run. Since the I/O isn't ready, the process cannot
proceed, wasting CPU time.
Evolution to the 5-State Model

To solve the inefficiency of the Two-State model, modern operating systems use
the Five-State Model depicted in your image. This model adds more "steps" to handle
different process conditions:
 New: Processes being created (Admission).

 Ready: Processes in memory, ready to run.

 Running: Process currently using the CPU.

 Waiting (Blocked): Processes waiting for an event (like I/O completion).

 Terminated: Processes that have finished execution.

Conclusion;

In summary, Process Scheduling is the essential mechanism that allows an operating


system to manage multiple tasks efficiently, maximizing CPU usage while ensuring fair
resource distribution.
The Two-State Process Model provides the foundational logic for this system,
simplifying the flow into a basic cycle: a process is either Running on the CPU or Not
Running in a queue. As shown in your diagram, this concept evolves into a more
complex network of Scheduling Queues—the Ready Queue for processes prepared
to execute and various Wait Queues for those delayed by I/O operations.
Ultimately, these components work together to minimize downtime and provide the
seamless multitasking experience we expect from modern computing.
REFERENCES

 Silberschatz, A., Galvin, P. B., & Gagne, G. (2018). Operating system


concepts (10th ed.). Wiley.

 Tanenbaum, A. S., & Bos, H. (2023). Modern operating systems (5th ed.). Pearson.

 Stallings, W. (2018). Operating systems: Internals and design principles (9th


ed.). Pearson.

You might also like