Concurrency
Concurrency is the logical simultaneous progress of multiple tasks (not necessarily physically simultaneous), achieved via threads/coroutines/event loops.
Purpose
Improve throughput and responsiveness, making full use of multiple cores and I/O wait time.
Mechanism
Threads: OS-scheduled and preemptive, sharing memory that requires synchronization. Coroutines: cooperative switching, lightweight. Event loop: single-threaded non-blocking I/O. Actors: message passing with no sharing. Concurrency ≠ parallelism (parallelism requires physical simultaneity on multiple cores).
Use cases
- Performance optimization
- System design
- Scalability
Related terms
Related tutorials
How to Use Optimistic Concurrency Control
An advanced-level guide covering optimistic, concurrency, database. Includes step-by-step instructions, common errors, troubleshooting tips, and security considerations for optimistic. TUTORIAL
How to Use Pessimistic Concurrency Control
An advanced-level guide covering pessimistic, concurrency, database. Includes step-by-step instructions, common errors, troubleshooting tips, and security considerations for pessimistic. TUTORIAL