Concurrency
Ability of a program to execute several tasks simultaneously or interleaved to avoid idle time.
Why in Automation
- bypass hundreds of pages faster than one by one;
- not wait in vain for API response;
- efficiently use the processor and network.
Types
- threads — threads within a process;
- async — asynchronous input/output;
- processes — separate processes.
Nuance
Concurrency speeds up, but complicates: race conditions and synchronization issues appear. Therefore, batch tasks often limit the number of simultaneous requests.