P

PrepStack

Process Synchronization

Synchronization is how programs that share data take turns so the data stays correct. Without it, two threads (separate paths of execution inside one program) updating one number can lose an update. Synchronization is a large topic in common OS question lists: the race condition, the critical section (the code that touches shared data) and its three requirements, locks, semaphores (counters that make a process wait), monitors (code that lets one process in at a time), and the classic problems. After this section you can trace a race, state the three requirements and work a semaphore trace by hand.

Topics in this section