concurrency
21 articles tagged concurrency.
-
Python Asyncio Task Cancellation
How asyncio delivers CancelledError at await points, propagates it through coroutines, and still runs cleanup during cancellation.
-
How Work-Stealing Deques Reduce Scheduler Contention
A work-stealing deque gives each worker fast local task operations while letting idle workers take tasks from the opposite end.
-
Go’s G-M-P Scheduler Explained
How Go’s scheduler maps goroutines onto OS threads, uses processors, and steals work when blocking would otherwise stop progress.
-
RCU Read-Side Critical Sections and Grace Periods
How RCU lets readers access shared data without locks while writers publish replacements and reclaim old versions safely.
-
Windows I/O Completion Ports
How Windows queues overlapped I/O completions to a bounded worker pool for scalable servers and services.
-
MVCC Snapshots and Row Version Visibility
How MVCC snapshots choose visible row versions so SQL readers and writers can run concurrently without blocking each other.
-
Linux Futexes: User-Space Fast Paths and Kernel Wait Queues
Futexes let synchronization stay in user space when uncontended and use kernel wait queues only when threads must sleep.
-
Acquire and Release Memory Ordering
How release operations publish prior writes to acquire operations without forcing every atomic access into one global order.
-
CPython’s Global Interpreter Lock
How CPython’s GIL protects interpreter state, makes threads contend, and affects CPU-bound and I/O-bound programs differently.
-
Python Asyncio Task Cancellation
Understand how asyncio injects CancelledError, propagates cancellation through awaited tasks, and lets coroutines clean up safely.
-
The Go Scheduler’s G-M-P Model
How goroutines, OS threads, processors, parking, wake-ups, and work stealing cooperate to keep Go code running efficiently.
-
Linux epoll: Interest Lists, Ready Lists, and Triggers
How epoll tracks watched descriptors, reports readiness, and lets one thread handle many connections with level- or edge-triggered events.
-
Rust Pin and Unpin for Self-Referential Futures
How Rust’s Pin and Unpin types keep asynchronous state machines at stable addresses when futures contain references to their own data.
-
Memory Barriers and Concurrent Memory Ordering
Memory barriers constrain compiler and CPU reordering so one thread can observe another’s updates in order, without making a whole operation atomic.
-
MVCC Snapshots and SQL Row Visibility
How SQL transactions choose visible row versions so readers can use a consistent view while writers update the same data.
-
TLB Shootdowns and Deferred Invalidation
How CPUs keep page-table changes safe, why TLB shootdowns interrupt other cores, and how batching reduces their performance cost.
-
Linux Futexes and User-Space Mutex Waiting
A futex lets a mutex use atomic user-space operations normally and enter the kernel only when a contending thread must sleep or be woken.
-
Go’s G-M-P Scheduler
How Go’s goroutines, OS threads, processors, run queues, and work stealing determine concurrency, latency, and throughput.
-
Inside Python’s asyncio Event Loop
How await suspends a Task, how I/O and timers wake it, and how the event loop chooses callbacks from its ready queue.
-
Windows I/O Completion Ports and Worker Scheduling
How Windows turns completed overlapped I/O into queued packets and limits runnable workers instead of assigning a thread to every operation.
-
CPython’s Global Interpreter Lock
How CPython’s GIL protects interpreter state, coordinates thread execution, and lets native extensions run parallel or blocking work safely.