Semaphores.html
* created: 2026-06-02T17:00
* modified: 2026-06-02T18:26
title
Title
description
Description
related notes
Semaphores
A structure that synchronizes access to shared across multiple threads, by limiting the amout of threads that can access the resource.
Examples: Pool
resource.acquire(); // Blocks thread until resource is available
// do something...
resource.release(); // Signals all other threads that the resource is free
Counting semaphors allow access across n threads, while binary semaphors ensure mutal exclusion -- think Mutex.