- Concurrency: the art of doing several things at the same time
- Implementing patterns
- race condition, synchronization, volatility
- visibility, false sharing, happens-before
Accessing data concurrently may lead to issue!
It means that two different threads are trying to read and write the same variable at the same time.
Prevents a block of code to be executed by more than one thread at the same time.
A deadlock is a situation where a thread
- create an instance of Runnable
- pass it to the constructor of the Thread class
- call start() method of this thread object