Thread Stack

Thread Stack

Exploring threads, stacks, and software engineering.

How to Write Deterministic Unit Tests for Concurrent Code

How to Write Deterministic Unit Tests for Concurrent Code

Concurrency tests flake because they sleep and hope. Inject clocks and executors, drive a fake scheduler,...

Explainer: What Happens When You Type a URL and Press Enter?

Explainer: What Happens When You Type a URL and Press Enter?

The route from keystroke to rendered page, layer by layer: browser cache, DNS, TCP, TLS, HTTP, the server,...

Common Mistakes in Thread Pool Configuration (and How to Fix Them)

Common Mistakes in Thread Pool Configuration (and How to Fix Them)

Unbounded queues, blocking tasks and pools sized by guesswork cause most concurrency pain. Here is how to...

How to Profile CPU and Memory in .NET Applications Using dotnet-counters

How to Profile CPU and Memory in .NET Applications Using dotnet-counters

dotnet-counters streams live CPU, GC heap and thread pool metrics from a running .NET process. Here's how...

Comparing Mutexes, Semaphores and Channels for Shared-State Safety

Comparing Mutexes, Semaphores and Channels for Shared-State Safety

Mutexes, semaphores and channels all prevent race conditions, but each fits a different job. Here is how...

Concurrency Checklist: 12 Questions to Ask Before Shipping Multithreaded Code

Concurrency Checklist: 12 Questions to Ask Before Shipping Multithreaded Code

A practical twelve-question pre-release checklist covering shared state, locking, cancellation, exception...