Click here to start

Table of contents

Chapter 6: Process Synchronization

Module 6: Process Synchronization

Background

Producer

Consumer

Race Condition

Solution to Critical-Section Problem

Peterson’s Solution

Algorithm for Process Pi

Synchronization Hardware

TestAndndSet Instruction

Solution using TestAndSet

Swap Instruction

Solution using Swap

Semaphore

Semaphore as General Synchronization Tool

Semaphore Implementation

Semaphore Implementation with no Busy waiting

Semaphore Implementation with no Busy waiting (Cont.)

Deadlock and Starvation

Classical Problems of Synchronization

Bounded-Buffer Problem

Bounded Buffer Problem (Cont.)

Slide 24

Readers-Writers Problem

Readers-Writers Problem (Cont.)

Slide 27

Dining-Philosophers Problem

Dining-Philosophers Problem (Cont.)

Problems with Semaphores

Monitors

Schematic view of a Monitor

Condition Variables

Monitor with Condition Variables

Solution to Dining Philosophers

Solution to Dining Philosophers (cont)

Slide 37

Monitor Implementation Using Semaphores

Monitor Implementation

Slide 40

Synchronization Examples

Solaris Synchronization

Windows XP Synchronization

Linux Synchronization

Pthreads Synchronization

Atomic Transactions

System Model

Types of Storage Media

Log-Based Recovery

Log-Based Recovery Algorithm

Checkpoints

Concurrent Transactions

Serializability

Schedule 1: T0 then T1

Nonserial Schedule

Schedule 2: Concurrent Serializable Schedule

Locking Protocol

Two-phase Locking Protocol

Timestamp-based Protocols

Timestamp-based Protocol Implementation

Timestamp-ordering Protocol

Schedule Possible Under Timestamp Protocol

End of Chapter 6

Author: Silberschatz, galvin, and Gagne

Homepage: http://www.cs.yale.edu/homes/avi/os-book/os7/index.html

Further information:
All pages copyright © 2005 John Wiley & Sons, Inc.