A critical section is a program segment
A critical section is a program segment where shared resources are accessed.
In concurrent programming, concurrent accesses to shared resources can lead to unexpected or erroneous behaviour, so parts of the program where the shared resource is accessed are protected. This protected section is the critical section . It cannot be executed by more than one process at a time.
A critical section is the part of a program that accesses shared resources. Only when a process is in its critical section can it be in a position to disrupt other processes. We can avoid race conditions by making sure that no two processes enter their critical sections at the same time.
Critical section is a piece of code that accesses a shared resource that must not be concurrently accessed by more than one thread of execution.