SlideShare a Scribd company logo
1
Processes and Threads
Part 2
2.1 Processes
2.2 Threads
2.3 Interprocess communication
2.4 Scheduling
2
2.1 Processes
3
Processes
The Process Model
• (a) Multiprogramming of four programs
• (b) Conceptual model of 4 independent, sequential
processes
• (c) Only one program active at any instant
4
Processes
Process Concept
• An operating system executes a variety of programs:
– Batch system – jobs
– Time-shared systems – user programs or tasks
• Process – a program in execution; process execution must
progress in sequential fashion
• A process resources includes:
– Address space (text segment, data segment)
– CPU (virtual)
• program counter
• registers
• stack
– Other resource (open files, child processes…)
5
Processes
Process in Memory
6
Processes
Process Creation (1)
Principal events that cause process creation
1. System initialization
2. Execution of a process creation system
Call
3. User request to create a new process
4. Initiation of a batch job
7
Processes
Process Creation (2)
• Address space
– Child duplicate of parent
– Child has a program loaded into it
• UNIX examples
– fork system call creates new process
– exec system call used after a fork to replace the
process’ memory space with a new program
8
Processes
Process Creation (3) : Example
9
Processes
Process Termination
Conditions which terminate processes
1. Normal exit (voluntary)
2. Error exit (voluntary)
3. Fatal error (involuntary)
4. Killed by another process (involuntary)
10
Processes
Process Hierarchies
• Parent creates a child process, child processes
can create its own process
• Forms a hierarchy
– UNIX calls this a "process group"
• Windows has no concept of process hierarchy
– all processes are created equal
11
Processes
Process States (1)
• Possible process states
– running
– blocked
– ready
• Transitions between states shown
12
Processes
Process States (2)
• Lowest layer of process-structured OS
– handles interrupts, scheduling
• Above that layer are sequential processes
13
Processes
Process Control Block (PCB)
14
Processes
context switch
15
Processes
Implementation of Processes (1)
Fields of a process table entry
16
CPU utilization as a function of the number of processes in memory.
Modeling Multiprogramming
17
2.2 Threads
18
Threads
The Thread Model
(a) Three processes each with one thread
(b) One process with three threads
- A thread – Lightweight Process is a basic unit of CPU utilization
19
Threads
Process with single thread
• A process (heavyweight):
– Address space (text section, data section)
– Single thread of execution
• program counter
• registers
• Stack
– Other resource (open files, child processes…)
20
Threads
Process with multiple threads
Multiple threads of execution in the same
environment of process
– Address space (text section, data section)
– Multiple threads of execution, each thread has
private set:
• program counter
• registers
• stack
– Other resource (open files, child processes…)
21
Threads
Single and Multithreaded Processes
PC
PC PC PC
22
Threads
Items shared and Items private
• Items shared by all threads in a process
• Items private to each thread
23
Threads
Benefits
• Responsiveness
• Resource Sharing
• Economy
• Utilization of Multiprocessor Architectures
24
Threads
Thread Usage (1)
A word processor with three threads
25
Threads
Thread Usage (2)
A multithreaded Web server
26
Threads
Thread Usage (3)
• Rough outline of code for previous slide
(a) Dispatcher thread
(b) Worker thread
27
Threads
Implementing Threads in User Space (1)
A user-level threads package
28
Threads
Implementing Threads in User Space (2)
• Thread library, (run-time system) in user
space
• thread_create
• thread_exit
• thread_wait
• thread_yield (to voluntarily give up the CPU)
• Thread control block (TCB) ( Thread Table Entry)
stores states of user thread (program counter,
registers, stack)
• Kernel does not know the present of user thread
29
Threads
Implementing Threads in User Space (3)
thread library
u u u
thread library
u u u
thread library
u u u
user
thread
kernel
• Traditional OS provide only one “kernel thread” presented
by PCB for each process.
– Blocking problem: If one user thread is blocked ->the
kernel thread is blocked, -> all other threads in process
are blocked.
PCBPCB PCB
30
Threads
Implementing Threads in the Kernel (1)
A threads package managed by the kernel
31
Threads
Implementing Threads in the Kernel (2)
• Multithreading is directly supported by OS:
– Kernel manages processes and threads
– CPU scheduling for thread is performed in kernel
• Advantage of multithreading in kernel
– Is good for multiprocessor architecture
– If one thread is blocked does not cause the other thread
to be blocked.
• Disadvantage of Multithreading in kernel
– Creation and management of thread is slower
32
Threads
Hybrid Implementations
Multiplexing user-level threads onto
kernel- level threads
33
2.3 Interprocess
Communication
34
Cooperating Processes
• Independent process cannot affect or be affected by the
execution of another process
• Cooperating process can affect or be affected by the
execution of another process
• Advantages of process cooperation
– Information sharing
– Computation speed-up
– Modularity
– Convenience
35
Problem of shared data
• Concurrent access to shared data may result in data
inconsistency
• Maintaining data consistency requires mechanisms to
ensure the orderly execution of cooperating processes
• Need of mechanism for processes to communicate and to
synchronize their actions
36
Race Conditions
• Two processes want to access shared memory at same time and the final result
depends who runs precisely, are called race condition
• Mutual exclusion is the way to prohibit more than one process from accessing
to shared data at the same time
• Example of race condition
37
Critical Regions (1)
The Part of the program where the shared memory is accessed is called
Critical Regions (Critical Section)
Four conditions to provide mutual exclusion
1. No two processes simultaneously in critical region
2. No assumptions made about speeds or numbers of CPUs
3. No process running outside its critical region may block another
process
4. No process must wait forever to enter its critical region
38
Critical Regions (2)
Mutual exclusion using critical regions (Example)
39
Solution: Mutual exclusion with Busy waiting
• Software proposal
– Lock Variables
– Strict Alternation
– Peterson's Solution
• Hardware proposal
– Disabling Interrupts
– The TSL Instruction
40
Mutual exclusion with Busy waiting
Software Proposal 1: Lock Variables
41
Mutual exclusion with Busy waiting
Software Proposal 1: Event
42
Mutual exclusion with Busy waiting
Software Proposal 2: Strict Alternation
43
Mutual exclusion with Busy waiting
Software Proposal 2: Strict Alternation
• Only 2 processes
• Responsibility Mutual Exclusion
– One variable "turn“, one process “turn” come
in CS at the moment.
44
Mutual exclusion with Busy waiting
Software Proposal 3: Peterson's Solution
Boolean
45
Mutual exclusion with Busy waiting
Software Proposal 3: Peterson's Solution
46
Mutual exclusion with Busy waiting
Comment for Software Proposal 3:
Peterson's Solution
• Satisfy 3 conditions:
– Mutual Exclusion
• Pi can enter CS when interest[j] == F, or turn == i
• If both want to come back, because turn can only receive value
0 or 1, so one process enter CS
– Progress
• Using 2 variables distinct interest[i] ==> opposing cannot lock
– Bounded Wait: both interest[i] and turn change value
• Not extend into N processes
47
Mutual exclusion with Busy waiting
Comment for Busy-Waiting solutions
• Don't need system’s support
• Hard to extend
• Solution 1 is better when atomicity is
supported
48
Mutual exclusion with Busy waiting
Hardware Proposal 1: Disabling Interrupt (1)
• Disable Interrupt: prohibit all interrupts, including spin interrupt
• Enable Interrupt: permit interrupt
49
Mutual exclusion with Busy waiting
Hardware proposal 1: Disable Interrupt (2)
• Not be careful
– If process is locked in CS?
• System Halt
– Permit process use command privileges
• Danger!
• System with N CPUs?
– Don't ensure Mutual Exclusion
50
Mutual exclusion with Busy waiting
Hardware proposal 2: TSL Instruction
• CPU support primitive Test and Set Lock
– Return a variable's current value, set variable to
true value
– Cannot divide up to perform (Atomic)
51
Mutual exclusion with Busy waiting
Hardware proposal 2: Applied TSL
52
Mutual exclusion with Busy waiting
Comment for hardware solutions
• Necessary hardware mechanism's support
– Not easy with n-CPUs system
• Easily extend to N processes
53
Mutual exclusion with Busy waiting
Comment
• Using CPU not effectively
– Constantly test condition when wait for coming
in CS
• Overcome
– Lock processes that not enough condition to
come in CS, concede CPU to other process
• Using Scheduler
• Wait and See...
54
Synchronous solution with Sleep & Wakeup
– Semaphore
– Monitor
– Message passing
55
"Sleep & Wake up" solution
• Give up CPU when not come in CS
• When CS is empty, will be waken up to come in CS
• Need support of OS
– Because of changing status of process
,
56
"Sleep & Wake up" solution: Idea
• OS support 2 primitive:
– Sleep(): System call receives blocked status
– WakeUp(P): P process receives ready status
• Application
– After checking condition, coming in CS or calling
Sleep() depend on result of checking
– Process that using CS before, will wake up processes
blocked before
57
Apply Sleep() and Wakeup()
58
Problem with Sleep & WakeUp
• Reason:
– Checking condition and giving up CPU can be
broken
– Lock variable is not protected
59
Synchronous solution with Sleep & Wakeup
Semaphore
• Suggested by Dijkstra, 1965
• Properties: Semaphore s (special integer
variable;)
– Unique value
– Manipulate with 2 primitives:
• Down(s), (Originally called P(s))
• Up(s), (Originally called V(s))
– Down and Up primitives executed cannot
divide up (atomic)
60
Synchronous solution with Sleep & Wakeup
Semaphore
• Counting semaphore – integer value can range over an unrestricted
domain
• Binary semaphore – integer value can range only between 0
and 1; can be simpler to implement
– Also known as mutex locks
• Can implement a counting semaphore s as a binary semaphore
• Provides mutual exclusion
– Semaphore S; // initialized to 1
– Down(s);
Critical Section
– Up(s);
61
Synchronous solution with Sleep & Wakeup
Install Semaphore (Sleep & Wakeup)
• With each semaphore there is an associated waiting queue.
Each entry in a waiting queue has two data items:
– value (of type integer)
– pointer to next record in the list
• Two operations:
– Sleep(): – place the process invoking the operation on the
appropriate waiting queue.
– WakeUp(): – remove one of processes in the waiting
queue and place it in the ready queue.
62
Synchronous solution with Sleep & Wakeup
Install Semaphore (Sleep & Wakeup)
63
Synchronous solution with Sleep & Wakeup
Install Semaphore (Sleep & Wakeup)
64
Synchronous solution with Sleep & Wakeup
Using Semaphore
65
Synchronous solution with Sleep & Wakeup
Monitor
• Hoare (1974) & Brinch (1975)
• Synchronous mechanism is provided by
programming language
– Support with functions, such as Semaphore
– Easier for using and detecting than Semaphore
• Ensure Mutual Exclusion automatically
• Using condition variable to perform
Synchronization
66
Synchronous solution with Sleep & Wakeup
Monitor: structure
67
Synchronous solution with Sleep & Wakeup
Monitor: structure
monitor monitor-name
{
shared variable declarations
procedure body P1 (…) {
. . .
}
procedure body P2 (…) {
. . .
}
procedure body Pn (…) {
. . .
}
{
initialization code
}
}
68
Synchronous solution with Sleep & Wakeup
Using Monitor
69
Synchronous solution with Sleep & Wakeup
Message Passing
• Processes must name each other explicitly:
– send (P, message) – send a message to process P
– receive(Q, message) – receive a message from process
Q
• Properties of communication link
– Links are established automatically
– A link is associated with exactly one pair of
communicating processes
– Between each pair there exists exactly one link
– The link may be unidirectional, but is usually bi-
directional
70
Classical Problems of Synchronization
• Bounded-Buffer Problem
(Producer-Consumer Problem)
• Readers and Writers Problem
• Dining-Philosophers Problem
71
2.4 Scheduling
72
Scheduling
Introduction to Scheduling (1)
• Maximum CPU utilization obtained with
multiprogramming
• CPU–I/O Burst Cycle – Process
execution consists of a cycle of CPU
execution and I/O wait
• CPU burst distribution
73
Scheduling
Introduction to Scheduling (2)
• Bursts of CPU usage alternate with periods of I/O wait
– (a) a CPU-bound process
– (b) an I/O-bound process
74
Scheduling
Introduction to Scheduling (3)
Three level scheduling
75
Scheduling
Introduction to Scheduling (4)
• Job Scheduler: higher-level scheduler
– Job scheduling responsibilities
– Job initiation based on certain criteria
• Job Scheduler functions
– Selects incoming job from queue
– Places in process queue
– Decides on job initiation criteria
• Process scheduling algorithm and priority
76
Scheduling
Introduction to Scheduling (5)
• Goal Job Scheduler
– Sequence jobs
• Efficient system resource utilization
– Balance I/O interaction and computation
– Keep most system components busy most of
time
77
Scheduling
Introduction to Scheduling (6)
• Process (CPU) Scheduler: lower-level scheduler
– Process scheduling responsibilities
– Determines execution steps
– Process scheduling based on certain criteria
• Process Scheduler functions
– Determines job to get CPU resource
• When and how long
– Decides interrupt processing
– Determines queues for job movement during execution
– Recognizes job conclusion
• Determines job termination
• Lower-level scheduler in the hierarchy
78
Scheduling
Introduction to Scheduling (7)
• Middle-level scheduler: third layer
• Found in highly interactive environments
– Handles overloading
• Removes active jobs from memory
• Reduces degree of multiprogramming
– Results in faster job completion
• Single-user environment
– No distinction between job and process scheduling
– One job active at a time
• Receives dedicated system resources for job duration
79
Scheduling
Introduction to Scheduling (8)
• Selects from among the processes in memory that are ready to execute,
and allocates the CPU to one of them
• CPU scheduling decisions may take place when a process:
1. Switches from running to waiting state
2. Switches from running to ready state
3. Switches from waiting or new process is created to ready
4. Terminates
• Nonpreemptive scheduling algorithm picks process and let it run until
it blocks or until it voluntarily releases the CPU
• preemptive scheduling algorithm picks process and let it run for a
maximum of fix time
80
Scheduling
Introduction to Scheduling (9)
readyready runningrunning
dispatch
interrupt
I/O or event
completion
I/O or
event wait
newnew
terminatedterminated
waitingwaiting
admit exit
81
Scheduling
Introduction to Scheduling (10)
Scheduling Criteria
• CPU utilization – keep the CPU as busy as possible
• Throughput – # of processes that complete their execution
per time unit
• Turnaround time – amount of time to execute a particular
process
• Waiting time – amount of time a process has been waiting
in the ready queue
• Response time – amount of time it takes from when a
request was submitted until the first response is produced,
not output (for time-sharing environment)
82
Scheduling
Introduction to Scheduling (11)
Optimization Criteria
• Max CPU utilization
• Max throughput
• Min turnaround time
• Min waiting time
• Min response time
83
Scheduling
Introduction to Scheduling (12)
Scheduling Algorithm Goals
84
Scheduling
Scheduling in Batch Systems (1)
First-Come, First-Served (FCFS) Scheduling
Process Burst Time
P1 24
P2 3
P3 3
• Suppose that the processes arrive in the order: P1 , P2 , P3
The Gantt Chart for the schedule is:
• Waiting time for P1 = 0; P2 = 24; P3= 27
• Average waiting time: (0 + 24 + 27)/3 = 17
P1 P2 P3
24 27 300
85
Scheduling
Scheduling in Batch Systems (2)
FCFS Scheduling (Cont.)
Suppose that the processes arrive in the order
P2 , P3 , P1
• The Gantt chart for the schedule is:
• Waiting time for P1 = 6;P2 = 0;P3 = 3
• Average waiting time: (6 + 0 + 3)/3 = 3
• Much better than previous case
• Convoy effect short process behind long process
P1P3P2
63 300
86
Scheduling
Scheduling in Batch Systems (3)
Shortest-Job-First (SJF) Scheduling
• Associate with each process the length of its next CPU burst. Use
these lengths to schedule the process with the shortest time
• Two schemes:
– nonpreemptive – once CPU given to the process it cannot be
preempted until completes its CPU burst
– preemptive – if a new process arrives with CPU burst length less
than remaining time of current executing process, preempt. This
scheme is know as the
Shortest-Remaining-Time-First (SRTF)
• SJF is optimal – gives minimum average waiting time for a given set
of processes
87
Process Arrival Time Burst Time
P1 0.0 7
P2 2.0 4
P3 4.0 1
P4 5.0 4
• SJF (non-preemptive)
• Average waiting time = (0 + 6 + 3 + 7)/4 = 4
Scheduling
Scheduling in Batch Systems (4)
Example of Non-Preemptive SJF
P1 P3 P2
73 160
P4
8 12
88
Scheduling
Scheduling in Batch Systems (5)
An example of shortest job first scheduling:
– Average waiting time ?
– Average turnaround time ?
89
Scheduling
Scheduling in Interactive Systems (1)
• Round Robin Scheduling
– list of runnable processes (a)
– list of runnable processes after B uses up its quantum (b)
90
Scheduling
Scheduling in Interactive Systems (2)
Round Robin (RR)`
• Each process gets a small unit of CPU time (time
quantum), usually 10-100 milliseconds. After this time
has elapsed, the process is preempted and added to the end
of the ready queue.
• If there are n processes in the ready queue and the time
quantum is q, then each process gets 1/n of the CPU time
in chunks of at most q time units at once. No process
waits more than (n-1)q time units.
• Performance
– q large ⇒ FCFS
– q small ⇒ q must be large with respect to context switch,
otherwise overhead is too high
91
Scheduling
Scheduling in Interactive Systems (3)
Example of RR with Time Quantum = 20
Process Burst Time
P1 53
P2 17
P3 68
P4 24
• The Gantt chart is:
Typically, higher average turnaround than SJF, but better response
P1 P2 P3 P4 P1 P3 P4 P1 P3 P3
0 20 37 57 77 97 117 121 134 154 162
92
Scheduling
Priority Scheduling (1)
Priority Scheduling: A priority number (integer) is associated
with each process
– The CPU is allocated to the process with the highest priority
– Preemptive
– nonpreemptive
• SJF is a priority scheduling where priority is the predicted next CPU
burst time
• Problem ≡ Starvation – low priority processes may never execute
• Solution ≡ Aging – as time progresses increase the priority of the
process
93
Scheduling
Priority Scheduling (2)
A scheduling algorithm with four priority classes
94
Scheduling
Priority Scheduling (3)
Example of Multilevel Queue
• Ready queue is partitioned into separate queues:
foreground (interactive)
background (batch)
• Each queue has its own scheduling algorithm
– foreground – RR
– background – FCFS
• Scheduling must be done between the queues
– Fixed priority scheduling; (i.e., serve all from foreground then
from background). Possibility of starvation.
– Time slice – each queue gets a certain amount of CPU time which
it can schedule amongst its processes; i.e., 80% to foreground in
RR, 20% to background in FCFS
95
Scheduling
Priority Scheduling (4)
Example of Multilevel Queue
96
Scheduling
Scheduling in Real-Time Systems (1)
• Hard real-time systems – required to
complete a critical task within a guaranteed
amount of time
• Soft real-time computing – requires that
critical processes receive priority over less
fortunate ones
97
Scheduling
Scheduling in Real-Time Systems(2)
Schedulable real-time system
• Given
– m periodic events
– event i occurs within period Pi and requires Ci
seconds
• Then the load can only be handled if
1
1
m
i
i i
C
P=
≤∑
98
Scheduling
Policy versus Mechanism
• Separate what is allowed to be done with
how it is done
– a process knows which of its children threads
are important and need priority
• Scheduling algorithm parameterized
– mechanism in the kernel
• Parameters filled in by user processes
– policy set by user process
99
Scheduling
Thread Scheduling (1)
• Local Scheduling – How the threads
library decides which thread to put onto
an available
• Global Scheduling – How the kernel
decides which kernel thread to run next
100
Scheduling
Thread Scheduling (2)
Possible scheduling of user-level threads
• 50-msec process quantum
• threads run 5 msec/CPU burst
101
Scheduling
Thread Scheduling (3)
Possible scheduling of kernel-level threads
• 50-msec process quantum
• threads run 5 msec/CPU burst

More Related Content

PPTX
Structure of operating system
GayathriS578276
 
PPTX
Operating system 33 swapping
Vaibhav Khanna
 
PPTX
Deadlock Prevention
prachi mewara
 
PPTX
Component level design
Midhula Chandren
 
PDF
Understanding The Boot Process
Dom Cimafranca
 
PPTX
Memory organisation
ankush_kumar
 
PPT
Memory Management in OS
vampugani
 
PPT
Multicore computers
Syed Zaid Irshad
 
Structure of operating system
GayathriS578276
 
Operating system 33 swapping
Vaibhav Khanna
 
Deadlock Prevention
prachi mewara
 
Component level design
Midhula Chandren
 
Understanding The Boot Process
Dom Cimafranca
 
Memory organisation
ankush_kumar
 
Memory Management in OS
vampugani
 
Multicore computers
Syed Zaid Irshad
 

What's hot (20)

PPT
08 Operating System Support
Jeanie Delos Arcos
 
PPTX
Real time Operating System
Tech_MX
 
PPTX
Computer Network - Network Layer
Manoj Kumar
 
PPTX
Backup and recovery
dhawal mehta
 
PPT
OS Services, System call, Virtual Machine
Divya S
 
PPTX
Multithreading computer architecture
Haris456
 
PPTX
Process scheduling
V.V.Vanniaperumal College for Women
 
PDF
Operating System-Ch8 memory management
Syaiful Ahdan
 
PPTX
Multiprocessor
Neel Patel
 
PPT
Multi core-architecture
Piyush Mittal
 
PPSX
Cocomo model
Devan Thakur
 
PPT
deadlock avoidance
wahab13
 
PPTX
Operating system - Process and its concepts
Karan Thakkar
 
PPTX
Operating system paging and segmentation
hamza haseeb
 
PPTX
Introduction to Parallel and Distributed Computing
Sayed Chhattan Shah
 
PPTX
Paging and Segmentation
Madhur Gupta
 
PPTX
Paging and segmentation
Piyush Rochwani
 
PPT
Parallel processing
Syed Zaid Irshad
 
08 Operating System Support
Jeanie Delos Arcos
 
Real time Operating System
Tech_MX
 
Computer Network - Network Layer
Manoj Kumar
 
Backup and recovery
dhawal mehta
 
OS Services, System call, Virtual Machine
Divya S
 
Multithreading computer architecture
Haris456
 
Operating System-Ch8 memory management
Syaiful Ahdan
 
Multiprocessor
Neel Patel
 
Multi core-architecture
Piyush Mittal
 
Cocomo model
Devan Thakur
 
deadlock avoidance
wahab13
 
Operating system - Process and its concepts
Karan Thakkar
 
Operating system paging and segmentation
hamza haseeb
 
Introduction to Parallel and Distributed Computing
Sayed Chhattan Shah
 
Paging and Segmentation
Madhur Gupta
 
Paging and segmentation
Piyush Rochwani
 
Parallel processing
Syed Zaid Irshad
 
Ad

Viewers also liked (7)

ODP
6. processes and threads
Marian Marinov
 
PDF
Race condition
hama7230
 
PDF
Inter process communication
RJ Mehul Gadhiya
 
PPT
Interprocess communication
Sushil Singh
 
PPT
Inter process communication
Mohd Tousif
 
PPT
Op Sy 03 Ch 23
Google
 
PDF
Inter Process Communication
Anil Kumar Pugalia
 
6. processes and threads
Marian Marinov
 
Race condition
hama7230
 
Inter process communication
RJ Mehul Gadhiya
 
Interprocess communication
Sushil Singh
 
Inter process communication
Mohd Tousif
 
Op Sy 03 Ch 23
Google
 
Inter Process Communication
Anil Kumar Pugalia
 
Ad

Similar to Processes and Thread OS_Tanenbaum_3e (20)

PPT
Process and Thread
Poornima E.G.
 
PPT
Processes and Threads in modern Operating system
ssuserf2075d
 
PPT
OPERATING SYSTEM CHAPTER 3.ppt
GevitaChinnaiah
 
PPT
procress and threads.ppt
DrBashirMSaad
 
PPT
Processes, Threads and Scheduler
Munazza-Mah-Jabeen
 
PPT
MODERN OPERATING SYSTEMS Chapter02 Processes and Threads.ppt
ahnenerbecafeopen
 
PPTX
9-Operating Systems -Synchronization, interprocess communication, deadlock.pptx
sekkiran
 
PPTX
Lecture 5 inter process communication
Kumbirai Junior Muzavazi
 
PDF
Lecture 5 process synchronization
KlintonChhun
 
PPTX
Operating Systems
Harshith Meela
 
PPT
Intro Basic of OS .ppt
Varsha506533
 
PPT
Chapter 02
Google
 
PPT
Chapter 02
Geonyzl Alviola
 
PPT
Ipc feb4
Ruchi Sharma
 
PPTX
Chapter -2 operating system presentation
chnrketan
 
PPT
Chapter three- Process Synchronization.ppt
ruhamadana111
 
PDF
Threads lecture slides for operating systems
amirtarek401
 
PDF
The Thread Chapter 4 of Operating System
mohammadhaidarayoobi
 
PDF
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 
Process and Thread
Poornima E.G.
 
Processes and Threads in modern Operating system
ssuserf2075d
 
OPERATING SYSTEM CHAPTER 3.ppt
GevitaChinnaiah
 
procress and threads.ppt
DrBashirMSaad
 
Processes, Threads and Scheduler
Munazza-Mah-Jabeen
 
MODERN OPERATING SYSTEMS Chapter02 Processes and Threads.ppt
ahnenerbecafeopen
 
9-Operating Systems -Synchronization, interprocess communication, deadlock.pptx
sekkiran
 
Lecture 5 inter process communication
Kumbirai Junior Muzavazi
 
Lecture 5 process synchronization
KlintonChhun
 
Operating Systems
Harshith Meela
 
Intro Basic of OS .ppt
Varsha506533
 
Chapter 02
Google
 
Chapter 02
Geonyzl Alviola
 
Ipc feb4
Ruchi Sharma
 
Chapter -2 operating system presentation
chnrketan
 
Chapter three- Process Synchronization.ppt
ruhamadana111
 
Threads lecture slides for operating systems
amirtarek401
 
The Thread Chapter 4 of Operating System
mohammadhaidarayoobi
 
CS9222 ADVANCED OPERATING SYSTEMS
Kathirvel Ayyaswamy
 

Recently uploaded (20)

PDF
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
PDF
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
PPTX
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
PPTX
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
PPTX
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
PPTX
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
DOCX
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PDF
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
PDF
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PDF
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
PDF
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
PPTX
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
20ME702-Mechatronics-UNIT-1,UNIT-2,UNIT-3,UNIT-4,UNIT-5, 2025-2026
Mohanumar S
 
dse_final_merit_2025_26 gtgfffffcjjjuuyy
rushabhjain127
 
database slide on modern techniques for optimizing database queries.pptx
aky52024
 
MT Chapter 1.pptx- Magnetic particle testing
ABCAnyBodyCanRelax
 
business incubation centre aaaaaaaaaaaaaa
hodeeesite4
 
Ppt for engineering students application on field effect
lakshmi.ec
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
22PCOAM21 Session 2 Understanding Data Source.pptx
Guru Nanak Technical Institutions
 
Civil Engineering Practices_BY Sh.JP Mishra 23.09.pptx
bineetmishra1990
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
SAR - EEEfdfdsdasdsdasdasdasdasdasdasdasda.docx
Kanimozhi676285
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
EVS+PRESENTATIONS EVS+PRESENTATIONS like
saiyedaqib429
 
Packaging Tips for Stainless Steel Tubes and Pipes
heavymetalsandtubes
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
67243-Cooling and Heating & Calculation.pdf
DHAKA POLYTECHNIC
 
Chad Ayach - A Versatile Aerospace Professional
Chad Ayach
 
IoT_Smart_Agriculture_Presentations.pptx
poojakumari696707
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 

Processes and Thread OS_Tanenbaum_3e

  • 1. 1 Processes and Threads Part 2 2.1 Processes 2.2 Threads 2.3 Interprocess communication 2.4 Scheduling
  • 3. 3 Processes The Process Model • (a) Multiprogramming of four programs • (b) Conceptual model of 4 independent, sequential processes • (c) Only one program active at any instant
  • 4. 4 Processes Process Concept • An operating system executes a variety of programs: – Batch system – jobs – Time-shared systems – user programs or tasks • Process – a program in execution; process execution must progress in sequential fashion • A process resources includes: – Address space (text segment, data segment) – CPU (virtual) • program counter • registers • stack – Other resource (open files, child processes…)
  • 6. 6 Processes Process Creation (1) Principal events that cause process creation 1. System initialization 2. Execution of a process creation system Call 3. User request to create a new process 4. Initiation of a batch job
  • 7. 7 Processes Process Creation (2) • Address space – Child duplicate of parent – Child has a program loaded into it • UNIX examples – fork system call creates new process – exec system call used after a fork to replace the process’ memory space with a new program
  • 9. 9 Processes Process Termination Conditions which terminate processes 1. Normal exit (voluntary) 2. Error exit (voluntary) 3. Fatal error (involuntary) 4. Killed by another process (involuntary)
  • 10. 10 Processes Process Hierarchies • Parent creates a child process, child processes can create its own process • Forms a hierarchy – UNIX calls this a "process group" • Windows has no concept of process hierarchy – all processes are created equal
  • 11. 11 Processes Process States (1) • Possible process states – running – blocked – ready • Transitions between states shown
  • 12. 12 Processes Process States (2) • Lowest layer of process-structured OS – handles interrupts, scheduling • Above that layer are sequential processes
  • 15. 15 Processes Implementation of Processes (1) Fields of a process table entry
  • 16. 16 CPU utilization as a function of the number of processes in memory. Modeling Multiprogramming
  • 18. 18 Threads The Thread Model (a) Three processes each with one thread (b) One process with three threads - A thread – Lightweight Process is a basic unit of CPU utilization
  • 19. 19 Threads Process with single thread • A process (heavyweight): – Address space (text section, data section) – Single thread of execution • program counter • registers • Stack – Other resource (open files, child processes…)
  • 20. 20 Threads Process with multiple threads Multiple threads of execution in the same environment of process – Address space (text section, data section) – Multiple threads of execution, each thread has private set: • program counter • registers • stack – Other resource (open files, child processes…)
  • 21. 21 Threads Single and Multithreaded Processes PC PC PC PC
  • 22. 22 Threads Items shared and Items private • Items shared by all threads in a process • Items private to each thread
  • 23. 23 Threads Benefits • Responsiveness • Resource Sharing • Economy • Utilization of Multiprocessor Architectures
  • 24. 24 Threads Thread Usage (1) A word processor with three threads
  • 25. 25 Threads Thread Usage (2) A multithreaded Web server
  • 26. 26 Threads Thread Usage (3) • Rough outline of code for previous slide (a) Dispatcher thread (b) Worker thread
  • 27. 27 Threads Implementing Threads in User Space (1) A user-level threads package
  • 28. 28 Threads Implementing Threads in User Space (2) • Thread library, (run-time system) in user space • thread_create • thread_exit • thread_wait • thread_yield (to voluntarily give up the CPU) • Thread control block (TCB) ( Thread Table Entry) stores states of user thread (program counter, registers, stack) • Kernel does not know the present of user thread
  • 29. 29 Threads Implementing Threads in User Space (3) thread library u u u thread library u u u thread library u u u user thread kernel • Traditional OS provide only one “kernel thread” presented by PCB for each process. – Blocking problem: If one user thread is blocked ->the kernel thread is blocked, -> all other threads in process are blocked. PCBPCB PCB
  • 30. 30 Threads Implementing Threads in the Kernel (1) A threads package managed by the kernel
  • 31. 31 Threads Implementing Threads in the Kernel (2) • Multithreading is directly supported by OS: – Kernel manages processes and threads – CPU scheduling for thread is performed in kernel • Advantage of multithreading in kernel – Is good for multiprocessor architecture – If one thread is blocked does not cause the other thread to be blocked. • Disadvantage of Multithreading in kernel – Creation and management of thread is slower
  • 32. 32 Threads Hybrid Implementations Multiplexing user-level threads onto kernel- level threads
  • 34. 34 Cooperating Processes • Independent process cannot affect or be affected by the execution of another process • Cooperating process can affect or be affected by the execution of another process • Advantages of process cooperation – Information sharing – Computation speed-up – Modularity – Convenience
  • 35. 35 Problem of shared data • Concurrent access to shared data may result in data inconsistency • Maintaining data consistency requires mechanisms to ensure the orderly execution of cooperating processes • Need of mechanism for processes to communicate and to synchronize their actions
  • 36. 36 Race Conditions • Two processes want to access shared memory at same time and the final result depends who runs precisely, are called race condition • Mutual exclusion is the way to prohibit more than one process from accessing to shared data at the same time • Example of race condition
  • 37. 37 Critical Regions (1) The Part of the program where the shared memory is accessed is called Critical Regions (Critical Section) Four conditions to provide mutual exclusion 1. No two processes simultaneously in critical region 2. No assumptions made about speeds or numbers of CPUs 3. No process running outside its critical region may block another process 4. No process must wait forever to enter its critical region
  • 38. 38 Critical Regions (2) Mutual exclusion using critical regions (Example)
  • 39. 39 Solution: Mutual exclusion with Busy waiting • Software proposal – Lock Variables – Strict Alternation – Peterson's Solution • Hardware proposal – Disabling Interrupts – The TSL Instruction
  • 40. 40 Mutual exclusion with Busy waiting Software Proposal 1: Lock Variables
  • 41. 41 Mutual exclusion with Busy waiting Software Proposal 1: Event
  • 42. 42 Mutual exclusion with Busy waiting Software Proposal 2: Strict Alternation
  • 43. 43 Mutual exclusion with Busy waiting Software Proposal 2: Strict Alternation • Only 2 processes • Responsibility Mutual Exclusion – One variable "turn“, one process “turn” come in CS at the moment.
  • 44. 44 Mutual exclusion with Busy waiting Software Proposal 3: Peterson's Solution Boolean
  • 45. 45 Mutual exclusion with Busy waiting Software Proposal 3: Peterson's Solution
  • 46. 46 Mutual exclusion with Busy waiting Comment for Software Proposal 3: Peterson's Solution • Satisfy 3 conditions: – Mutual Exclusion • Pi can enter CS when interest[j] == F, or turn == i • If both want to come back, because turn can only receive value 0 or 1, so one process enter CS – Progress • Using 2 variables distinct interest[i] ==> opposing cannot lock – Bounded Wait: both interest[i] and turn change value • Not extend into N processes
  • 47. 47 Mutual exclusion with Busy waiting Comment for Busy-Waiting solutions • Don't need system’s support • Hard to extend • Solution 1 is better when atomicity is supported
  • 48. 48 Mutual exclusion with Busy waiting Hardware Proposal 1: Disabling Interrupt (1) • Disable Interrupt: prohibit all interrupts, including spin interrupt • Enable Interrupt: permit interrupt
  • 49. 49 Mutual exclusion with Busy waiting Hardware proposal 1: Disable Interrupt (2) • Not be careful – If process is locked in CS? • System Halt – Permit process use command privileges • Danger! • System with N CPUs? – Don't ensure Mutual Exclusion
  • 50. 50 Mutual exclusion with Busy waiting Hardware proposal 2: TSL Instruction • CPU support primitive Test and Set Lock – Return a variable's current value, set variable to true value – Cannot divide up to perform (Atomic)
  • 51. 51 Mutual exclusion with Busy waiting Hardware proposal 2: Applied TSL
  • 52. 52 Mutual exclusion with Busy waiting Comment for hardware solutions • Necessary hardware mechanism's support – Not easy with n-CPUs system • Easily extend to N processes
  • 53. 53 Mutual exclusion with Busy waiting Comment • Using CPU not effectively – Constantly test condition when wait for coming in CS • Overcome – Lock processes that not enough condition to come in CS, concede CPU to other process • Using Scheduler • Wait and See...
  • 54. 54 Synchronous solution with Sleep & Wakeup – Semaphore – Monitor – Message passing
  • 55. 55 "Sleep & Wake up" solution • Give up CPU when not come in CS • When CS is empty, will be waken up to come in CS • Need support of OS – Because of changing status of process ,
  • 56. 56 "Sleep & Wake up" solution: Idea • OS support 2 primitive: – Sleep(): System call receives blocked status – WakeUp(P): P process receives ready status • Application – After checking condition, coming in CS or calling Sleep() depend on result of checking – Process that using CS before, will wake up processes blocked before
  • 58. 58 Problem with Sleep & WakeUp • Reason: – Checking condition and giving up CPU can be broken – Lock variable is not protected
  • 59. 59 Synchronous solution with Sleep & Wakeup Semaphore • Suggested by Dijkstra, 1965 • Properties: Semaphore s (special integer variable;) – Unique value – Manipulate with 2 primitives: • Down(s), (Originally called P(s)) • Up(s), (Originally called V(s)) – Down and Up primitives executed cannot divide up (atomic)
  • 60. 60 Synchronous solution with Sleep & Wakeup Semaphore • Counting semaphore – integer value can range over an unrestricted domain • Binary semaphore – integer value can range only between 0 and 1; can be simpler to implement – Also known as mutex locks • Can implement a counting semaphore s as a binary semaphore • Provides mutual exclusion – Semaphore S; // initialized to 1 – Down(s); Critical Section – Up(s);
  • 61. 61 Synchronous solution with Sleep & Wakeup Install Semaphore (Sleep & Wakeup) • With each semaphore there is an associated waiting queue. Each entry in a waiting queue has two data items: – value (of type integer) – pointer to next record in the list • Two operations: – Sleep(): – place the process invoking the operation on the appropriate waiting queue. – WakeUp(): – remove one of processes in the waiting queue and place it in the ready queue.
  • 62. 62 Synchronous solution with Sleep & Wakeup Install Semaphore (Sleep & Wakeup)
  • 63. 63 Synchronous solution with Sleep & Wakeup Install Semaphore (Sleep & Wakeup)
  • 64. 64 Synchronous solution with Sleep & Wakeup Using Semaphore
  • 65. 65 Synchronous solution with Sleep & Wakeup Monitor • Hoare (1974) & Brinch (1975) • Synchronous mechanism is provided by programming language – Support with functions, such as Semaphore – Easier for using and detecting than Semaphore • Ensure Mutual Exclusion automatically • Using condition variable to perform Synchronization
  • 66. 66 Synchronous solution with Sleep & Wakeup Monitor: structure
  • 67. 67 Synchronous solution with Sleep & Wakeup Monitor: structure monitor monitor-name { shared variable declarations procedure body P1 (…) { . . . } procedure body P2 (…) { . . . } procedure body Pn (…) { . . . } { initialization code } }
  • 68. 68 Synchronous solution with Sleep & Wakeup Using Monitor
  • 69. 69 Synchronous solution with Sleep & Wakeup Message Passing • Processes must name each other explicitly: – send (P, message) – send a message to process P – receive(Q, message) – receive a message from process Q • Properties of communication link – Links are established automatically – A link is associated with exactly one pair of communicating processes – Between each pair there exists exactly one link – The link may be unidirectional, but is usually bi- directional
  • 70. 70 Classical Problems of Synchronization • Bounded-Buffer Problem (Producer-Consumer Problem) • Readers and Writers Problem • Dining-Philosophers Problem
  • 72. 72 Scheduling Introduction to Scheduling (1) • Maximum CPU utilization obtained with multiprogramming • CPU–I/O Burst Cycle – Process execution consists of a cycle of CPU execution and I/O wait • CPU burst distribution
  • 73. 73 Scheduling Introduction to Scheduling (2) • Bursts of CPU usage alternate with periods of I/O wait – (a) a CPU-bound process – (b) an I/O-bound process
  • 74. 74 Scheduling Introduction to Scheduling (3) Three level scheduling
  • 75. 75 Scheduling Introduction to Scheduling (4) • Job Scheduler: higher-level scheduler – Job scheduling responsibilities – Job initiation based on certain criteria • Job Scheduler functions – Selects incoming job from queue – Places in process queue – Decides on job initiation criteria • Process scheduling algorithm and priority
  • 76. 76 Scheduling Introduction to Scheduling (5) • Goal Job Scheduler – Sequence jobs • Efficient system resource utilization – Balance I/O interaction and computation – Keep most system components busy most of time
  • 77. 77 Scheduling Introduction to Scheduling (6) • Process (CPU) Scheduler: lower-level scheduler – Process scheduling responsibilities – Determines execution steps – Process scheduling based on certain criteria • Process Scheduler functions – Determines job to get CPU resource • When and how long – Decides interrupt processing – Determines queues for job movement during execution – Recognizes job conclusion • Determines job termination • Lower-level scheduler in the hierarchy
  • 78. 78 Scheduling Introduction to Scheduling (7) • Middle-level scheduler: third layer • Found in highly interactive environments – Handles overloading • Removes active jobs from memory • Reduces degree of multiprogramming – Results in faster job completion • Single-user environment – No distinction between job and process scheduling – One job active at a time • Receives dedicated system resources for job duration
  • 79. 79 Scheduling Introduction to Scheduling (8) • Selects from among the processes in memory that are ready to execute, and allocates the CPU to one of them • CPU scheduling decisions may take place when a process: 1. Switches from running to waiting state 2. Switches from running to ready state 3. Switches from waiting or new process is created to ready 4. Terminates • Nonpreemptive scheduling algorithm picks process and let it run until it blocks or until it voluntarily releases the CPU • preemptive scheduling algorithm picks process and let it run for a maximum of fix time
  • 80. 80 Scheduling Introduction to Scheduling (9) readyready runningrunning dispatch interrupt I/O or event completion I/O or event wait newnew terminatedterminated waitingwaiting admit exit
  • 81. 81 Scheduling Introduction to Scheduling (10) Scheduling Criteria • CPU utilization – keep the CPU as busy as possible • Throughput – # of processes that complete their execution per time unit • Turnaround time – amount of time to execute a particular process • Waiting time – amount of time a process has been waiting in the ready queue • Response time – amount of time it takes from when a request was submitted until the first response is produced, not output (for time-sharing environment)
  • 82. 82 Scheduling Introduction to Scheduling (11) Optimization Criteria • Max CPU utilization • Max throughput • Min turnaround time • Min waiting time • Min response time
  • 83. 83 Scheduling Introduction to Scheduling (12) Scheduling Algorithm Goals
  • 84. 84 Scheduling Scheduling in Batch Systems (1) First-Come, First-Served (FCFS) Scheduling Process Burst Time P1 24 P2 3 P3 3 • Suppose that the processes arrive in the order: P1 , P2 , P3 The Gantt Chart for the schedule is: • Waiting time for P1 = 0; P2 = 24; P3= 27 • Average waiting time: (0 + 24 + 27)/3 = 17 P1 P2 P3 24 27 300
  • 85. 85 Scheduling Scheduling in Batch Systems (2) FCFS Scheduling (Cont.) Suppose that the processes arrive in the order P2 , P3 , P1 • The Gantt chart for the schedule is: • Waiting time for P1 = 6;P2 = 0;P3 = 3 • Average waiting time: (6 + 0 + 3)/3 = 3 • Much better than previous case • Convoy effect short process behind long process P1P3P2 63 300
  • 86. 86 Scheduling Scheduling in Batch Systems (3) Shortest-Job-First (SJF) Scheduling • Associate with each process the length of its next CPU burst. Use these lengths to schedule the process with the shortest time • Two schemes: – nonpreemptive – once CPU given to the process it cannot be preempted until completes its CPU burst – preemptive – if a new process arrives with CPU burst length less than remaining time of current executing process, preempt. This scheme is know as the Shortest-Remaining-Time-First (SRTF) • SJF is optimal – gives minimum average waiting time for a given set of processes
  • 87. 87 Process Arrival Time Burst Time P1 0.0 7 P2 2.0 4 P3 4.0 1 P4 5.0 4 • SJF (non-preemptive) • Average waiting time = (0 + 6 + 3 + 7)/4 = 4 Scheduling Scheduling in Batch Systems (4) Example of Non-Preemptive SJF P1 P3 P2 73 160 P4 8 12
  • 88. 88 Scheduling Scheduling in Batch Systems (5) An example of shortest job first scheduling: – Average waiting time ? – Average turnaround time ?
  • 89. 89 Scheduling Scheduling in Interactive Systems (1) • Round Robin Scheduling – list of runnable processes (a) – list of runnable processes after B uses up its quantum (b)
  • 90. 90 Scheduling Scheduling in Interactive Systems (2) Round Robin (RR)` • Each process gets a small unit of CPU time (time quantum), usually 10-100 milliseconds. After this time has elapsed, the process is preempted and added to the end of the ready queue. • If there are n processes in the ready queue and the time quantum is q, then each process gets 1/n of the CPU time in chunks of at most q time units at once. No process waits more than (n-1)q time units. • Performance – q large ⇒ FCFS – q small ⇒ q must be large with respect to context switch, otherwise overhead is too high
  • 91. 91 Scheduling Scheduling in Interactive Systems (3) Example of RR with Time Quantum = 20 Process Burst Time P1 53 P2 17 P3 68 P4 24 • The Gantt chart is: Typically, higher average turnaround than SJF, but better response P1 P2 P3 P4 P1 P3 P4 P1 P3 P3 0 20 37 57 77 97 117 121 134 154 162
  • 92. 92 Scheduling Priority Scheduling (1) Priority Scheduling: A priority number (integer) is associated with each process – The CPU is allocated to the process with the highest priority – Preemptive – nonpreemptive • SJF is a priority scheduling where priority is the predicted next CPU burst time • Problem ≡ Starvation – low priority processes may never execute • Solution ≡ Aging – as time progresses increase the priority of the process
  • 93. 93 Scheduling Priority Scheduling (2) A scheduling algorithm with four priority classes
  • 94. 94 Scheduling Priority Scheduling (3) Example of Multilevel Queue • Ready queue is partitioned into separate queues: foreground (interactive) background (batch) • Each queue has its own scheduling algorithm – foreground – RR – background – FCFS • Scheduling must be done between the queues – Fixed priority scheduling; (i.e., serve all from foreground then from background). Possibility of starvation. – Time slice – each queue gets a certain amount of CPU time which it can schedule amongst its processes; i.e., 80% to foreground in RR, 20% to background in FCFS
  • 96. 96 Scheduling Scheduling in Real-Time Systems (1) • Hard real-time systems – required to complete a critical task within a guaranteed amount of time • Soft real-time computing – requires that critical processes receive priority over less fortunate ones
  • 97. 97 Scheduling Scheduling in Real-Time Systems(2) Schedulable real-time system • Given – m periodic events – event i occurs within period Pi and requires Ci seconds • Then the load can only be handled if 1 1 m i i i C P= ≤∑
  • 98. 98 Scheduling Policy versus Mechanism • Separate what is allowed to be done with how it is done – a process knows which of its children threads are important and need priority • Scheduling algorithm parameterized – mechanism in the kernel • Parameters filled in by user processes – policy set by user process
  • 99. 99 Scheduling Thread Scheduling (1) • Local Scheduling – How the threads library decides which thread to put onto an available • Global Scheduling – How the kernel decides which kernel thread to run next
  • 100. 100 Scheduling Thread Scheduling (2) Possible scheduling of user-level threads • 50-msec process quantum • threads run 5 msec/CPU burst
  • 101. 101 Scheduling Thread Scheduling (3) Possible scheduling of kernel-level threads • 50-msec process quantum • threads run 5 msec/CPU burst

Editor's Notes

  • #17: <number>