The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+18 votes
1.6k 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
  4. a deadlock
asked in Operating System by Veteran (59.6k points) | 1.6k views

1 Answer

+27 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.4k points)
selected by
+3
Why are we relating speed to ordering?
+7

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!?
+16

@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 .


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

40,903 questions
47,560 answers
146,291 comments
62,306 users