← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Structured Concurrency PHP 8.1+
A model where child tasks live inside a parent scope that waits for all of them to finish before it exits, so no task is ever orphaned.
2w ago Concurrency advanced
Mutex vs Semaphore PHP 7.0+ 🧠 1
A mutex allows only one thread to access a resource at a time — a semaphore controls access to a pool of N identical resources.
CWE-362
3mo ago Concurrency advanced
Actor Model
The Actor Model treats everything as an actor — isolated units that communicate only by message passing, never sharing state — eliminating race conditions by design.
3mo ago Concurrency advanced
Compare-And-Swap (CAS) 🧠 1
CAS atomically compares a memory location to an expected value and only swaps it if equal — the foundation of lock-free algorithms and optimistic concurrency control.
3mo ago Concurrency advanced
Lock-Free Programming 🧠 1
Lock-free algorithms guarantee system-wide progress without mutexes — using atomic CPU instructions (CAS) so at least one thread always makes forward progress even if others are delayed.
3mo ago Concurrency advanced
Memory Barriers & Visibility 🧠 1
Memory barriers (fences) force the CPU and compiler to complete memory operations in order — ensuring changes made by one thread are visible to others at the right time.
3mo ago Concurrency advanced
Swoole & Async PHP PHP 7.4+
Swoole is a PHP extension providing a coroutine-based async runtime — enabling non-blocking I/O, connection pools, and WebSocket servers without Node.js or external message brokers.
3mo ago Concurrency advanced
Compare-and-Swap (CAS) PHP 7.0+ 🧠 5
An atomic CPU instruction that updates a memory location only if it contains an expected value — the foundation of lock-free data structures and optimistic concurrency control.
3mo ago Concurrency advanced
Coroutines — Cooperative Multitasking PHP 8.1+ 🧠 1
Functions that explicitly yield control — enabling concurrent I/O without threads, where code decides when to pause rather than being preemptively interrupted.
3mo ago Concurrency advanced
Memory Visibility & Cache Coherence
In multi-processor systems, each CPU has a cache — writes by one CPU may not be visible to others without memory barriers. PHP's process-per-request model avoids most visibility issues.
3mo ago Concurrency advanced
PHP Concurrency Options PHP 7.0+
PHP's concurrency toolkit — Fibers for cooperative multitasking, pcntl for process forking, pthreads for true threading (CLI only), and async frameworks (ReactPHP, Amp).
3mo ago Concurrency advanced
Diagram: Deadlock, Livelock & Starvation Deadlock, Livelock & Starvation 🧠 1
Deadlock: processes wait for each other indefinitely. Livelock: processes keep changing state but make no progress. Starvation: a process is perpetually denied resources.
3mo ago Concurrency advanced
Diagram: Event Loop Internals Event Loop Internals PHP 8.1+
The mechanism that enables single-threaded async programs — a loop that checks for completed I/O events, runs their callbacks, then checks again.
3mo ago Concurrency advanced
✓ schema.org compliant