A critical section is typically used when a multithreaded program must update multiple related variables without a separate thread making conflicting changes itical section may be used to ensure a shared resource, for example a printer, can only be accessed by one process at a time.
A critical section is typically used when a multithreaded program must update multiple related variables without a separate thread making conflicting changes to that data. In a related situation, a critical section may be used to ensure a shared resource, for example a printer, can only be accessed by one process at a time.