0% found this document useful (0 votes)
3 views

Operating System Threads and Scheduling

This presentation discusses threads and scheduling in operating systems, comparing user-level and kernel-level threads, and exploring various scheduling algorithms. It highlights the importance of thread management, synchronization, and the impact of scheduling on CPU utilization and process performance. Real-world applications in Linux and Windows are also examined, emphasizing the role of scheduling in modern multitasking operating systems.

Uploaded by

doshisayammi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Operating System Threads and Scheduling

This presentation discusses threads and scheduling in operating systems, comparing user-level and kernel-level threads, and exploring various scheduling algorithms. It highlights the importance of thread management, synchronization, and the impact of scheduling on CPU utilization and process performance. Real-world applications in Linux and Windows are also examined, emphasizing the role of scheduling in modern multitasking operating systems.

Uploaded by

doshisayammi
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Operating System

Threads and
Scheduling
This presentation covers threads and scheduling in operating
systems. We will compare user-level and kernel-level threads. We will
also explore scheduling algorithms and real-world applications. Let's
start our journey into OS internals.

SD
by SAYAMMI DOSHI
User-Level Threads vs. Kernel-Level Thread
User-Level Threads (ULT) Kernel-Level Threads (KLT)

Managed by a user-level library. The kernel is unaware of Managed directly by the OS kernel. Each KLT can run in
these threads. parallel on multiprocessors.

• Fast context switching. • Kernel manages threads.


• Portable across OS. • Slower context switching.
• Blocking system calls block entire process. • One thread blocking doesn't block others.
Thread Management:
Libraries and
Synchronization
Thread Libraries Race Conditions
POSIX Threads (Pthreads) is Occur when multiple threads
a standard API for thread access shared data
creation and synchronization. concurrently. The final result
Windows Threads are depends on execution order.
specific to the Windows OS.

Deadlocks
Two or more threads are blocked. Each is waiting for the other to
release a resource.
Scheduling in Operating
Systems

What is CPU Utilization Throughput


Scheduling?
Keep the CPU as busy Number of processes
Scheduling as possible. completed per unit of
determines which time.
process or thread gets
CPU time.

Turnaround Time
Time to execute a
process.
Types of Scheduling: A Comparison
Long-Term Scheduling Short-Term Scheduling Medium-Term Scheduling

Controls the degree of Selects which process should Reduces degree of multiprogramming.
multiprogramming. execute next.
• Swapping.
• Job scheduling. • CPU scheduling. • Remove process from memory.
• Selects processes from the pool. • Invoked very frequently. • Later re-introduced into memory.
• Executed much less frequently. • Must be very fast.
CPU Scheduling Algorithms
FCFS SJN
First Come First Serve. Shortest Job Next.

Simple, but can cause convoy effect. Minimizes average waiting time.

Round Robin Priority


Each process gets a time slice. Processes assigned priorities.

Fair, but context switching overhead. Higher priority gets CPU first.
Real-World Application:
Linux vs. Windows
Linux
Uses a Completely Fair Scheduler (CFS).

Windows
Hybrid approach with priority-based scheduling.

Process management is crucial for modern multitasking OS. Threads


improve application performance. Scheduling algorithms ensure
efficient and fair CPU utilization.
Thank You

You might also like