Computer Science - Operating Systems Concepts - Discussion
Discussion Forum : Operating Systems Concepts - Section 1 (Q.No. 3)
3.
To avoid the race condition, the number of processes that may be simultaneously inside their critical section is
Discussion:
22 comments Page 2 of 3.
Shashak goyal said:
1 decade ago
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.
Anupama said:
1 decade ago
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.
Keshika said:
1 decade ago
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.
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.
Rajesh said:
1 decade ago
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.
Maharaj Sudhir Sisodiya said:
1 decade ago
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.
Ananth said:
1 decade ago
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.
Vijay chilkoti said:
1 decade ago
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.
Jag said:
1 decade ago
Race condition also known like a deadlock problem by the form threads.
Ashok said:
1 decade ago
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.
Ganesh said:
1 decade ago
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.
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers