Back to Developer Roadmap

Synchronization

src/data/roadmaps/server-side-game-developer/content/[email protected]

4.0703 B
Original Source

Synchronization

In the context of multithreading, synchronization is a mechanism which ensures that two or more concurrent threads don't simultaneously execute some particular program segment known as a critical section. Concurrent accesses to shared resource can lead to race conditions. Two or more operating systems' threads can access shared data simultaneously. With synchronization, you can ensure that only one thread can access the shared resource at a time, hence avoiding any data inconsistency. Different synchronization techniques such as locks, semaphores, condition variables, monitors and signaling are used to deal with synchronization situations, each with its own pros and cons.