Synchronisation is an important property of concurrent and distributed systems.
There are two main types of synchronisation methods:
- Blocking methods — require each element (thread, process) pause for an arbitrary amount of time. For example, consider mutexes, which force threads to take turns accessing shared data. If one thread locks the mutex, the other thread must wait (get blocked) until the first thread releases the lock.
- These are susceptible to deadlock and livelock, where the entire system gets stuck due to threads waiting for each other.
- Lockless methods — ensure the system is always making forward progress. No thread can cause another to wait indefinitely.