TODO: concurrency vs. asynchronous concurrency vs. multithreading concurrency vs. parallelism
When talking about concurrency issues, it often involves concurrent access to the same shared data in memory, however, it can involve concurrent access to other resources such as files and databases.
Concurrency and parallelism have very similar meanings in English, but there is a distinction to be clarified about their meanings in computer science contexts:
- Concurrency is just when 2+ parts of the code of a program can run at the same time on different cores of a CPU, different CPUs of a computer, or different computers connected to each other.
- Parallelism is when they do run at the same time.
âConcurrency is a software mechanism, and parallelism is a hardware concern.â - Pragmatic Programmer.
TODO: Critical region.
See actors
See mutex.
See semaphores.