in Operating System edited by
840 views
0 votes
0 votes
What is the main reason for RACE condition while synchronzing the process?
A)The two processes trying to update the variable at same time.

B) More than one process entering into the critical section at same time.

C)Mutual Exclusion condition not satisfies.

D)All of the above
in Operating System edited by
840 views

4 Comments

the reading value is in consistent, isn't it... It may read before writing it gives one value and after writing it leads to some other value
1
1

first of all acc to u,what do u mean by critical section @Shubhanshu

@Parth Shah

if u read the def of critical section, then it is the code which consists of one or more race condition;

so more than 1 process should not  enter the critical section at the same time ;

and it is same as saying mutual condition does not holds;

so i guess all the three options are correct ;hence D, although even i marked A but i think all are correct!!

1
1
How can we say at the same time? We usually talk about processes, deadlock, critical section... topics on single processor system. Race condition occurs when one process enters critical section while the other process is already in it. So correct answer should be option C.
1
1

1 Answer

0 votes
0 votes
The race condition occurs when

1. The two processes share the same variable and try to manipulate at the same time.

2. At most only one process is allowed inside the critical section. Hence, a race condition may also occur when more than one processes enter the critical section.

3. Mutual exclusion says that no other process is allowed to execute in the critical section when one process is already executing.

Hence, option (D) is the correct answer.
by

2 Comments

Hence, a race condition may also occur when more than one processes enter the critical section.

race condition may or may not occur. So all of the above seems to be the main reason for race condition?

 

0
0

In computer science, mutual exclusion is a property of concurrency control, which is developed for the sake of preventing race conditions.

So, this is what the official definition of mutual exclusion says. Hence, (c) has to be in the answer as well.

What else you want to know?

0
0

Related questions