0% found this document useful (0 votes)
3 views1 page

Understanding Race Conditions and Critical Sections

Uploaded by

nilaja2003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views1 page

Understanding Race Conditions and Critical Sections

Uploaded by

nilaja2003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Process Synchronization

Q1. What is race condition? List three requirements that a solution to critical section problem must satisfy. (OR)
Explain critical section problem. Identify and explain three requirements that a solution to critical section problem
must satisfy.
Ans: A situation where several processes access and manipulate the data concurrently and the outcome of the
execution depends on the particular order in which the access takes place, is called a Race Condition.
➢ Each process has a segment of code, called a critical section in which the process may be changing common
variables, updating a table, writing a file and so on.
➢ The important feature of the system is that, when one process is executing in its critical section, no other
process is to be allowed to execute in its critical section.
➢ Each process must request permission to enter its critical section. The section of code implementing this
request is the entry section. The critical section may be followed by an exit section. The remaining code is the
remainder section.

➢ A solution to the critical-section problem must satisfy the following three requirements:
✓ Mutual exclusion: If process Pi is executing in its critical section, then no other processes can be
executing in their critical sections.
✓ Progress: If no process is executing in its critical section and some processes wish to enter their
critical sections, then only those processes that are not executing in their remainder sections can
participate in deciding which will enter its critical section next, and this selection cannot be
postponed indefinitely.
✓ Bounded waiting: There exits a bound, or limit, on the number of times that other processes are
allowed to enter their critical sections after a process has made a request to enter its critical section
and before that request is granted.
_______________________________________________________________________________________________

You might also like