Computer Science - Operating Systems Concepts - Discussion


To avoid the race condition, the number of processes that may be simultaneously inside their critical section is

[A]. 8
[B]. 1
[C]. 16
[D]. 0
[E]. None of the above

Answer: Option B


No answer description available for this question.

Anupama said: (Aug 6, 2011)  
Critical section is the part of program code where the program changes global variables, writing files etc. So entering more than one process in their critical section may cause race condition.

Mumtaz Gohar said: (Jan 21, 2012)  
In fact we need four conditions to hold.

No two processes may be simultaneously inside their critical sections.
No assumptions may be made about the speed or the number of processors.
No process running outside its critical section may block other processes.
No process should have to wait forever to enter its critical section.

Parsh said: (Jan 29, 2012)  
Race condition bring in the idea of critical section. Critical section is a mutually exclusive section whereby more than 1 process reading or writing the shared data is prohibited. So to avoid Race Condition, the following 4 conditions are needed

Ganesh said: (Jan 31, 2012)  
A situation where several process acess and manipulate the same data concurently and the outcomes of the execution depends on the particular order in which the access takes place is called a race condition and to guard against the raic condition above we need to ensure that only 1 process at a time cam be manipulating the variable counter.

Ashok said: (Jul 13, 2012)  
A race condition occurs when two threads access a shared variable at the same time. The first thread reads the variable, and the second thread reads the same value from the variable. Then the first thread and second thread perform their operations on the value, and they race to see which thread can write the value last to the shared variable. The value of the thread that writes its value last is preserved, because the thread is writing over the value that the previous thread wrote.

Jag said: (Sep 5, 2012)  
Race condition also known like a deadlock problem by the form threads.

Vijay Chilkoti said: (Nov 1, 2012)  
Race condition is that condition when two or more process are using the same data or shared resource and they all try to make change in that at the same time.

Ananth said: (Jan 26, 2013)  
If there are more more than two processes are in the critical section and accessing the variables, if one process increases the variable value and the other process is decreasing that variable value. We are unable to determine the value of the variable. Those two processes accessing the variable and manipulating the values simultaneously this will be resulted as the racing condition.

Maharaj Sudhir Sisodiya said: (Feb 8, 2013)  
A process is said to be in critical section when it accesses the shared variables, shared data , shared registers etc. For correct execution of a set of processes , the order of execution must be defined, another process may enter the critical section only when the previous process has exited. This will ensure that there is no dead lock or race among the process as to which process will change the data. This is somewhat similar to CSMA/CD in networking.

Rajesh said: (Feb 18, 2013)  
A situation in which multiple processes read and write a shared data item and the final result depends on the relative timing of their execution.

Keshika said: (Apr 11, 2013)  
Consider a system consisting of processes. Each process has a segment of code, called a critical section (CS) , 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 CS, no other process is to be allowed to execute in its CS.

That is, no two processes are executing in their CSs at the same time.

Each process must request permission to enter its CS. The section of code implementing this request is the entry section.

The CS may be followed by an exit section.

The remaining code is the remainder section.

Rajeev said: (May 24, 2013)  
In a critical section only one process should execute.

Shashak Goyal said: (Jul 2, 2013)  
Race condition brings in the idea of critical section. Race condition occurs when two threads try to access the shared data and change it at the same time.

Vaishnavi said: (Oct 15, 2014)  
No two process can be in their critical section at the same time. If not race condition may occur.

Mutex (mutual exclusion) helps to avoid 2 processes being in their critical section at the same time.

If the number of processes to be handled is more than 2, then semaphores can be used to avoid race condition.

Pooja said: (Sep 25, 2015)  
Entering more than one process in their critical section may cause race condition. So only one process entering at a time.

Mahendra said: (Dec 28, 2015)  
Final output of any variable depends on the execution sequence of the process. This condition is called as Race Condition.

Jeevan said: (Oct 15, 2016)  
The critical section allows only one process and executes wait() until the process is completed hence there can be one process.

Jahangeer said: (Jan 26, 2018)  
Well defined by @Ashok.

Nidhi said: (May 8, 2018)  
In a critical condition more than one threads can be simultaneously running in order to produce a result. Now the sequence of these threads may lead to different answer at the end of process (as the threads must have read and done the processing of your instruction). So, only one thread shall be processed in order to avoid various result out of the critical condition.

Joyi said: (Feb 20, 2019)  
If the order of execution of process determines the final state of a shared resource it's called race condition.

So, a better way to avoid is, do execution one after one.

Post your comments here:

Name *:

Email   : (optional)

» Your comments will be displayed only after manual approval.