The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+23 votes

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
  4. a deadlock
asked in Operating System by Veteran (52k points) | 2.4k views

1 Answer

+31 votes
Best answer

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
Why are we relating speed to ordering?

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.

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


In which order different  process arrive , if this order determine the final 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.


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 .

Related questions

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true
49,576 questions
54,190 answers
71,147 users