In concurrent programming, a code segment that accesses shared resources and must not be executed by more than one thread or process at a time.
In multithreaded programs, critical sections must be properly protected.
Use semaphores to prevent simultaneous access to the critical section.