Ch06 OS9e
Ch06 OS9e
Systems:
Internals Chapter 6
and Design Concurrency:
Principles
Deadlock and
Starvation
Ninth Edition
By William Stallings
Consumable
• One that can be created (produced) and destroyed (consumed)
• Interrupts, signals, messages, and information
• In I/O buffers
Circular Wait
The circular wait condition can be prevented by defining a linear
ordering of resource types
Deadlock
Avoidance
Resource Allocation
Denial Process Initiation
Denial
• Do not grant an
incremental resource • Do not start a process
request to a process if if its demands might
this allocation might lead to deadlock
lead to deadlock
Classes of resources
Swappable space
Blocks of memory on secondary storage for use in swapping processes
Process resources
Assignable devices, such as tape drives, and files
Main memory
Assignable to processes in pages or segments
Internal resources
Such as I/O channels
No philosopher
must starve to
death (avoid
deadlock and
starvation)
A Solution
to the
Dining
Philosophers
Problem
Using a
Monitor
Shared
Pipes Messages
memory
Semaphores Signals
Two types:
• Named
• Unnamed
Consists of:
UNIX Signals
Linux Atomic
Operations
Reader-writer semaphores
Linux
Semaphores
293 in textbook)
© 2017 Pearson Education, Inc., Hoboken, NJ. All rights reserved.
Table 6.6
The shared resources that the RCU mechanism protects must be accessed via a
pointer
The RCU mechanism provides access for multiple readers and writers to a
shared resource
Mutual
exclusion
(mutex) Semaphores
locks
In addition to the
concurrency
mechanisms of
UNIX SVR4, Solaris
supports four thread
synchronization
Condition primitives:
variables Readers/writer
locks
A condition variable
is used to wait until a
Condition variables
particular condition is
must be used in
true
conjunction with a
mutex lock
Windows
Synchronization
Objects
“Lock-free”