Thursday, January 22, 2015

WHAT IS CRITICAL SECTION?

A critical section is a region of code that should not be entered simultaneously by multiple threads. An example is code that manipulates global static data, since it could cause problems if multiple threads change the data simultaneously. Symbian OS provides the RCriticalSection class that allows only one thread within the process into the controlled section, forcing other threads attempting to gain access to that critical section to wait until the first thread has exited from the critical section.
While in critical section the thread cannot be suspended or killed. Any suspension or kill will be deferred until the thread leaves the critical section.

0 comments:

Post a Comment