The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+17 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 (59.5k points) | 1.5k views

1 Answer

+26 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 (55.1k 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.

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

37,996 questions
45,492 answers
48,592 users