← 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
Atomic Operations 🧠 2
An atomic operation completes entirely or not at all — no intermediate state is visible to other threads. Atomic ops are the building blocks of lock-free concurrency.
3mo ago Concurrency intermediate
Atomic Operations 🧠 5
Atomic operations complete indivisibly — no other thread can observe an intermediate state. The foundation for lock-free concurrency and database counters.
3mo ago Concurrency intermediate
Database Connection Pooling 🧠 2
Connection pooling reuses a fixed set of database connections across requests — eliminating the 50–200ms connection overhead on every request and limiting DB connection count.
3mo ago Concurrency intermediate
Deadlock 🧠 3
A deadlock occurs when two or more processes each hold a resource the other needs — both wait forever. Prevention requires consistent lock ordering or timeouts.
3mo ago Concurrency intermediate
Event-Driven Concurrency 🧠 1
Event-driven concurrency uses a single-threaded event loop to handle many concurrent I/O operations — no threads, no locks, but requires non-blocking code throughout.
3mo ago Concurrency intermediate
Goroutine-Style Concurrency
Goroutines (Go) and similar lightweight green threads — coroutines, fibers — enable thousands of concurrent tasks with minimal memory, multiplexed onto OS threads by a runtime scheduler.
3mo ago Concurrency intermediate
Mutex & Locking 🧠 3
A mutex (mutual exclusion lock) ensures only one thread/process can access a critical section at a time — the fundamental primitive for preventing race conditions.
3mo ago Concurrency intermediate
Optimistic Locking 🧠 2
Optimistic locking detects conflicts at commit time using a version number — no locks held during the transaction, high throughput for low-contention scenarios.
3mo ago Concurrency intermediate
Pessimistic Locking 🧠 5
Pessimistic locking acquires an exclusive lock immediately on read — preventing any concurrent modification. Right for high-contention scenarios but reduces throughput.
3mo ago Concurrency intermediate
Producer-Consumer Pattern
Producer-Consumer decouples work generation from processing — producers add to a queue, consumers process independently, buffering load spikes and enabling parallel throughput.
3mo ago Concurrency intermediate
Promises & Futures PHP 7.0+ 🧠 4
Abstractions representing the eventual result of an async operation — a Promise or Future is a placeholder for a value not yet available, enabling non-blocking code composition without nested callbacks.
3mo ago Concurrency intermediate
Race Condition 🧠 4
A race condition occurs when the outcome of a program depends on the relative timing of concurrent operations — two threads reading and writing shared state without coordination.
3mo ago Concurrency intermediate
Semaphore 🧠 5
A semaphore is a generalised mutex that allows N concurrent accesses — a counting semaphore with value N lets N threads proceed, blocking the (N+1)th.
3mo ago Concurrency intermediate
Starvation & Livelock
Starvation: a thread never gets resources because others monopolise them. Livelock: threads actively respond to each other but make no progress — like two people stepping aside for each other indefinitely.
3mo ago Concurrency intermediate
Thread Safety PHP 7.0+
Thread-safe code produces correct results regardless of how multiple threads interleave — achieved through immutability, atomic operations, or synchronisation primitives.
3mo ago Concurrency intermediate
Thundering Herd Problem
Thundering herd: many processes simultaneously wake up to handle one event — all compete, one wins, the rest wasted work. Common after cache expiry or server restart.
3mo ago Concurrency intermediate
Diagram: Asynchronous vs Parallel Execution Asynchronous vs Parallel Execution PHP 7.0+
Async enables concurrency within a single thread by interleaving tasks during I/O waits; parallel execution uses multiple threads/processes for true simultaneous CPU execution.
3mo ago Concurrency intermediate
Diagram: Processes vs Threads Processes vs Threads PHP 7.0+
Processes are independent execution units with separate memory; threads share memory within a process — threads are lighter but require synchronisation to be safe.
3mo ago Concurrency intermediate
✓ schema.org compliant