karnstack
Why this courseCurriculumStacktraceWaitlist
karnstack
All posts
Topic

#concurrency

2 posts

databases
Jan 15, 20268 min read
#03

How Postgres Prevents Both Deadlock AND Livelock in Upserts

A one-line rule buried in PostgreSQL's INSERT ... ON CONFLICT code prevents two of the nastiest concurrency bugs at once: the transaction with the higher XID backs out.

systems
Jan 2, 20266 min read
#02

How nginx Tells Time Without Asking

A lock-free time cache lets millions of nginx requests read the current time without waiting for each other. 64 pre-allocated slots, a memory barrier, and a bet that your thread won't sleep for a full minute.

© 2026 karnstack · by karn

© 2026 karnstack · by karn