CS2005 - Lecture 11 - Process Synchronisation

0.0(0)
Studied by 3 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 2:58 PM on 11/18/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

12 Terms

1
New cards

Critical Section Problem

When multiple processes/threads access shared data simultaneously, leading to race conditions (unpredictable results)

2
New cards

Solution Requirements for the Critical Section Problem

Mutual Exclusion: Only one process in CS at a time

Progress: No process outside CS should block others

Bounded Waiting: No process waits forever

3
New cards

Peterson's Algorithm

Uses turn and flag[2] variables to ensure mutual exclusion for two processes

4
New cards

Mutex Lock

A binary lock [acquire()/release()] that ensures only one process enters critical section

5
New cards

Semaphore

A synchronisation tool that can manage access by multiple processes to a shared resource, an integer variable with atomic "wait()" (P) and "signal()" (V) operations:

6
New cards

Avoiding Busy Waiting with Semaphore

Uses blocking/wakeup: wait(S) { S-; if (S < 0) { block(); } } signal(S) { S++; if (S <= 0) { wakeup(P); } }

7
New cards

Semaphores in Producer-Consumer Problem

Use three semaphores:

1. mutex (1 for CS access)

2. empty (n for empty slots)

3. full (0 for filled slots)

8
New cards

Solution for Dining Philosophers

Allow only 4 philosophers to eat or make one pick right-first

9
New cards

Deadlock in Dining Philosophers Problem

All philosophers simultaneously pick up their left chopstick, waiting indefinitely for the right one.

10
New cards

Deadlock vs Starvation

Deadlock: Two+ processes wait forever for each other's resources

Starvation: A process is indefinitely denied resources

11
New cards

Monitor in Synchronisation

A high-level construct where methods auto-synchronise (only 1 thread executes at a time)

12
New cards

Monitor

A class-like structure ensuring only one thread executes its methods at a time + No manual lock management - Less flexible than semaphores