Race Condition: Difference between revisions

From CasGroup
Jump to navigationJump to search
Jfromm (talk | contribs)
New page: A '''race condition''' can be defined as an anomalous behavior due to unexpected unexpected ordering of events and critical dependence on the relative timing of events. It characterizes ...
 
Eboxytezi (talk | contribs)
No edit summary
Line 1: Line 1:
=[http://egyworene.co.cc Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page]=
A '''race condition''' can be defined as an anomalous behavior  
A '''race condition''' can be defined as an anomalous behavior  
due to unexpected unexpected ordering of events and critical  
due to unexpected unexpected ordering of events and critical  
Line 13: Line 14:
in a [[Distributed System|distributed system]] may depend on the
in a [[Distributed System|distributed system]] may depend on the
arrival order of two different contradictory messages, the first says  
arrival order of two different contradictory messages, the first says  
"maintain object", whereas the second says "release object", and the message  
"maintain object", whereas the second says "release object", and the message  
which arrives first - the winner of the race - determines the result.
which arrives first - the winner of the race - determines the result.
A race condition can also occur when multiple processes access and manipulate  
A race condition can also occur when multiple processes access and manipulate  
Line 21: Line 22:
Race conditions are not only undesirable because the program doesn't  
Race conditions are not only undesirable because the program doesn't  
work as it's supposed to do. In debugging they are also very undesirable,  
work as it's supposed to do. In debugging they are also very undesirable,  
because you have to "run the race" many times before you can reproduce a  
because you have to "run the race" many times before you can reproduce a  
situation which a certain fault, error or failure. The error may also  
situation which a certain fault, error or failure. The error may also  
vanish if you slow the processes down by debugging the computation
vanish if you slow the processes down by debugging the computation
step-by-step.
step-by-step.

Revision as of 00:40, 24 November 2010

Page Is Unavailable Due To Site Maintenance, Please Visit Reserve Copy Page

A race condition can be defined as an anomalous behavior due to unexpected unexpected ordering of events and critical dependence on the relative timing of events. It characterizes an undesirable situation in a concurrent or distributed system where the cause for the output of a process depends on the arbitrary timing of other events. There are many participants (messages, threads, etc.) which have different speed, and each of the participants can win. Only the winner determines the resulting behavior.

In other words, the output of the process is unexpectedly and dependents critically on a sequence or timing of other events. For instance, a computation in a distributed system may depend on the arrival order of two different contradictory messages, the first says "maintain object", whereas the second says "release object", and the message which arrives first - the winner of the race - determines the result. A race condition can also occur when multiple processes access and manipulate the same data concurrently, and the outcome of the execution depends on the particular order in which the access takes place.

Race conditions are not only undesirable because the program doesn't work as it's supposed to do. In debugging they are also very undesirable, because you have to "run the race" many times before you can reproduce a situation which a certain fault, error or failure. The error may also vanish if you slow the processes down by debugging the computation step-by-step.