2.4k views

When the result of a computation depends on the speed of the processes involved, there is said to be

1. cycle stealing
2. race condition
3. a time lock
asked | 2.4k views

When final result depends on ordering of processes it is called Race condition.
Speed of processes corresponds to ordering of processes.

answered by Veteran (59.8k points)
selected by
+4
Why are we relating speed to ordering?
+8

Assuming there are 2 processes i.e. A & B.

if :

• A finishes first then order of execution is AB.

else :

• Order of execution is BA.

So, the output may vary accordingly.

+1
@bikram In which perspective odering and speed co-related!?
+17

@suvasish

In which order different  process arrive , if this order determine the final result..it is called race condition ..when 2 or more process trying to access same resource .. the final result is determined by which process finally do operation .

suppose , it is given :  int a[3] = { 3, 4, 5};

Then these 2 operations are done

Process 1

a[1] = a[0] + a[1];

Process 2

a[2] = a[1] + a[2];

Then  what will be the value of a[3] = { 3, ___, ___ } //  These blank parts depends which process execute at last .

if process 1 first then final result is  a[ ]={3,7,12}

if process 2 first then final result is a[ ]={3,7,9}

so you can see final result depends upon which process execute last .

This is an example of Race condition .

-------

By saying this :

Speed of processes corresponds to ordering of processes.

He wants to say

Speed of processes == ordering of processes.

Means both represents same thing.

0
Doubt

Sir ,you have  written "so you can see final result depends upon which process execute last ." It could be final result depend upon which process execute first.because when process 1 execute then we get some result and when process 2 execute we get some other  result .

1
2