Concurrency Review
Names the shared mutable state first, because every concurrency bug in the code follows from it.
Free — no card needed
Create a free account
to open Concurrency Review — and the other 364 prompts across 21 categories.
Already have an account?
Running it, start to finish
- List every piece of shared mutable state before analysing anything.
- Fix the check-then-act cases with atomic operations or constraints.
- Verify the synchronisation holds across multiple instances.
What you get back
The output this produces, every time.
- Enumerates shared mutable state first, which makes the rest of the analysis tractable.
- Finds every check-then-act shape, the most common source of production races.
- Asks whether synchronisation survives multiple instances, which is where scaling breaks things.
Getting better results
Where this usually goes wrong, and how to avoid it.
- Include the state you forget is state. Lazy singletons, memoised values and counters are shared mutable state and are where the surprising races live.
- Prefer a database constraint. For exists-then-create, a unique constraint cannot be forgotten by a future caller the way a lock can.
- Check locks held across I/O. It is correct and it destroys throughput, and it only shows up under load.
More Coding prompts
All Coding →- Coding
Review for the Bug, Not the Style
A code review that hunts correctness failures and states the exact input that breaks each one, instead of listing naming preferences.
ClaudeChatGPTGemini000Open → - Coding
Database Migration Plan
Plans a schema change that ships without downtime, in steps that are each independently safe and reversible.
ClaudeChatGPT000Open → - Coding
Refactor With a Safety Net
Plans a refactor as a sequence of individually safe, individually shippable steps, with the characterisation tests that make each one verifiable.
ClaudeChatGPT000Open →
Written for The AI University. Every prompt in this library is original work — authored, tested and revised here, not collected from elsewhere. 365 of them, free with an account.
