Concurrency for Backend Performances
Concurrency is how a backend handles many tasks at once, using threads, processes, event loops or lightweight coroutines. This unit also covers runtime tuning such as thread pool sizes, garbage collection and memory limits. The right model depends on whether the work is CPU-bound or waits on I/O.
Stage: Application Layer · Part of the Backend Performance roadmap · Last reviewed 19 November 2026
What to learn in Concurrency
- Choose between threads, processes and an event loop for a workload
- Explain why CPU-bound and I/O-bound work need different concurrency models
- Size a worker or thread pool using measured latency and core count
- Recognise a race condition and fix it with a lock or atomic operation
- Tune garbage collection or heap settings after reading runtime metrics
Concurrency interview questions
When is an event loop better than a thread per request?
For I/O-bound services that spend most time waiting on networks or disks, an event loop serves many connections on few threads with low memory overhead. It is a poor fit for heavy CPU work, which blocks the loop and delays every other request.
What is a deadlock and how can you avoid it?
A deadlock occurs when two or more tasks each hold a resource the other needs, so none can proceed. Avoid it by acquiring locks in a consistent global order, holding them briefly, using timeouts, or designing so fewer shared locks are required.
Where Concurrency fits in the Backend Performance roadmap
Concurrency belongs to the Application Layer stage (advanced level), which takes about 14 hours. Use resources well.
Other units in this stage
Back to the full Backend Performance roadmap