Concurrency
Concurrency is the organization of multiple activities whose lifetimes overlap, allowing each to make progress without requiring simultaneous execution.
Not independently verified. References are provided for review; their presence does not certify every claim.
Concurrency
Concurrency is the organization of multiple activities whose lifetimes overlap, allowing each to make progress without requiring simultaneous execution.
Overlap is the key
A service can begin several network requests and handle each result when it arrives. On a single CPU execution context, work may be interleaved. This is concurrent even if only one instruction stream runs at a time. Parallelism specifically involves simultaneous work.
Concurrency exists because many tasks spend time waiting for I/O, other services or resources. An event loop, threads and multiple processes are different mechanisms for managing it.
Ordering still matters
Suppose a user searches for “tcp” and then “tls”. The first request may finish last. If the UI blindly accepts every response, it can display obsolete results. Associate results with a request identifier or cancel obsolete work where supported.
This is an ordering bug even without shared-memory threads.
Design constraints
Bound the number of outstanding operations so queues cannot grow indefinitely. Define timeouts, cancellation and cleanup. Shared mutable resources need synchronization or ownership rules; asynchronous code does not remove these obligations.
Practice
Draw a timeline for three overlapping requests, including one failure and one cancellation. Specify which results the user should see. Assessment: explain the difference between a completed task, an abandoned caller and a stopped underlying operation. Continue with threads, testing · not yet documented and observability · not yet documented.
References and verification
These sources are provided for claim review. This article is Needs review; no verification date is asserted. Original research ranges, where available, are retained in the catalog.
- JavaScript execution model — MDN Web Docs.
- pthreads(7) — POSIX threads — Linux man-pages project.
References & provenance
MDN Web Docs · Official documentation · Needs review · Access date not recorded
- Agents, execution contexts, jobs and the event loop
Linux man-pages project · Technical reference · Needs review · Access date not recorded
- Process resources shared by threads and thread-specific state
Original research context, including questions and later corrections:
Research lines 10300–12352My learning
Your learning
Saved in this browser. Status and proficiency are independent.
Loading your saved workspace…