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
8
1
16
0
None of the above
Answer: Option
Explanation:
No answer description is available. Let's discuss.
Discussion:
22 comments Page 1 of 3.

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.

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.

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.

Nidhi said:   7 years ago
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.

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.

Mumtaz gohar said:   1 decade ago
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.

Vaishnavi said:   1 decade ago
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.

Parsh said:   1 decade ago
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

Owendrila Saha said:   4 years ago
In the case of process synchronisation, if we avoid race conditions then no two processes can enter in the critical section. If more than one process can enter the critical section then inconsistent results may come which cause race conditions.
(6)


Post your comments here:

Your comments will be displayed after verification.