Lecture 3: Semaphores

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

1/15

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 12:07 PM on 9/1/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

16 Terms

1
New cards

Semaphore

A special non-negative integer variable used for process synchronization, offering built-in power for mutual exclusion and condition synchronization.

2
New cards

P Operation (wait / down / acquire)

An atomic operation that waits until the semaphore value s > 0, then decrements s by 1.

3
New cards

V Operation (signal / up / release)

An atomic operation that increments the semaphore value s by 1 and awakens a blocked process if one is waiting.

4
New cards

Binary Semaphore

A semaphore that only takes values 0 or 1, most commonly used as a mutual exclusion lock (mutex).

5
New cards

Counting Semaphore

A general semaphore that can take any non-negative integer value, typically used to track available units of a shared resource.

6
New cards

Semaphore Fairness

Ensures that processes delayed inside P-operations are awoken in the order they were blocked (FIFO queueing).

7
New cards

Split Binary Semaphores

A set of binary semaphores where at most one semaphore in the set equals 1 at any given time (sum <= 1).

8
New cards

Bounded Buffer (Producer/Consumer)

A synchronization pattern that uses two counting semaphores (empty slots, full slots) and binary semaphores to protect array indices for asynchronous communication.

9
New cards

Dining Philosophers Problem

A classic concurrency problem illustrating deadlocks and resource allocation when multiple processes share limited adjacent resources.

10
New cards

Dining Philosophers Deadlock Solution

Break symmetry by requiring at least one process to pick up its required tools in reverse order (e.g., right tool first).

11
New cards

Readers/Writers Invariant

Allows multiple readers concurrent access when no writer is active, but requires exclusive access whenever a writer is modifying the dataset.

12
New cards

Passing the Baton Technique

An advanced design pattern where an exiting process evaluates state conditions and directly signals the specific semaphore of the next eligible waiting process.

13
New cards

Java Semaphore acquire()

Java method equivalent to the P operation; decrements permits or blocks until one is available.

14
New cards

Java Semaphore release()

Java method equivalent to the V operation; increments permits and unblocks a waiting thread.

15
New cards

Java Condition await()

Atomically releases an associated lock and suspends the thread until explicitly signaled by another thread.

16
New cards

Java Condition signal()

Wakes up one thread that is waiting on the given condition.