219k views
2 votes
-Give a definition of the critical section problem and explain the purpose of the entry and exit code blocks

User Maulik J
by
5.3k points

1 Answer

0 votes

Answer: In operating system a code segment which accesses some shared variables or resources one at a time atomically such other no other code or process is accessing that resource or variable at the same time.

Entry section code block allows the access to the shared resource or variable and exit section code signals the termination from access to the shared resource or variable.

Step-by-step explanation:

Entry and exit section codes needs to check certain properties before allowing the access and removal of access to a particular code segment.

These conditions are:

1. Bounded waiting.

2. Mutual exclusion.

3. checking thread execution status to allows other threads to enter the critical section (CS).

User Nesta
by
5.3k points