race condition


Also found in: Dictionary, Thesaurus, Medical, Wikipedia.
Related to race condition: Critical section

race condition

[′rās kən‚dish·ən]
(electricity)
An ambiguous condition occurring in control counters when one flip-flop changes to its next state before a second one has had sufficient time to latch.
McGraw-Hill Dictionary of Scientific & Technical Terms, 6E, Copyright © 2003 by The McGraw-Hill Companies, Inc.

race condition

Anomalous behavior due to unexpected critical dependence on the relative timing of events.

For example, if one process writes to a file while another is reading from the same location then the data read may be the old contents, the new contents or some mixture of the two depending on the relative timing of the read and write operations.

A common remedy in this kind of race condition is file locking; a more cumbersome remedy is to reorganize the system such that a certain processes (running a daemon or the like) is the only process that has access to the file, and all other processes that need to access the data in that file do so only via interprocess communication with that one process.

As an example of a more subtle kind of race condition, consider a distributed chat network like IRC, where a user is granted channel-operator privileges in any channel he starts. If two users on different servers, on different ends of the same network, try to start the same-named channel at the same time, each user's respective server will grant channel-operator privileges to each user, since neither will yet have received the other's signal that that channel has been started.

In this case of a race condition, the "shared resource" is the conception of the state of the network (what channels exist, as well as what users started them and therefore have what privileges), which each server is free to change as long as it signals the other servers on the network about the changes so that they can update their conception of the state of the network. However, the latency across the network makes possible the kind of race condition described. In this case, heading off race conditions by imposing a form of control over access to the shared resource -- say, appointing one server to be in charge of who holds what privileges -- would mean turning the distributed network into a centralized one (at least for that one part of the network operation). Where this is not acceptable, the more pragmatic solution is to have the system recognize when a race condition has occurred and to repair the ill effects.

Race conditions also affect electronic circuits where the value output by a logic gate depends on the exact timing of two or more input signals. For example, consider a two input AND gate fed with a logic signal X on input A and its negation, NOT X, on input B. In theory, the output (X AND NOT X) should never be high. However, if changes in the value of X take longer to propagate to input B than to input A then when X changes from false to true, there will be a brief period during which both inputs are true, and so the gate's output will also be true. If this output is fed to an edge-sensitive component such as a counter or flip-flop then the temporary effect ("glitch") will become permanent.
This article is provided by FOLDOC - Free Online Dictionary of Computing (foldoc.org)

race condition

An error condition in which two signals or sets of data collide. It can take place within a chip, a circuit, a network or an application. It can be due to a timing malfunction in the hardware or poorly written software.
Copyright © 1981-2019 by The Computer Language Company Inc. All Rights reserved. THIS DEFINITION IS FOR PERSONAL USE ONLY. All other reproduction is strictly prohibited without permission from the publisher.
References in periodicals archive ?
Michelin insists their tyres are legal but Ferrari and Bridgestone believe Michelin have been using front tyres that pass pre-race tests then change under race conditions to give improved grip.
Two feet of fresh snow and a wind-chill of minus 40 degrees F are not the most ideal race conditions. But for one ultra marathon cyclist, the more challenging the race, the better.
The increases will be made to race conditions in the coming days, so they come into force by the time the races close for entries.
FAVOURED by the race conditions, Meri Devie should be tough to beat in the Grade 3 Irish Independent Hurdle in Limerick.
RETIRED greyhounds were given a run out in Sutton Park last week without the pressure of race conditions.
Michael Bell's five-year-old was clobbered by the handicapper after that success and race conditions are certainly in his favour
The progressive four-year-old holds entries in both the Prince of Wales's Stakes and the Hardwicke Stakes, and whilst his handler stresses no firm decision has been made as to which contest he is to be aimed at, Muir concedes the race conditions of the latter are a ppealing.
On the one hand Michael had a good day, allowing us to get a deeper understanding of how the car functions in race conditions.
Roberts and Dave Watt, executive director of the American Running Association, which formed the group, hope to over time develop a participant death and injury registry, enabling medical response teams to better establish a course of action for a given distance under various race conditions. ARRMS sees annual or semi-annual meetings at races around the country as the most effective means for consolidating and disseminating the wealth of health and safety information it will no doubt amass.
"I was unsure whether the course could stage the Ascot Gold Cup and the Queen Alexandria Stakes, both over further than two miles, but William Derby plans to upgrade the track's run-off area to meet the required race conditions," he added.
A CHANGE in the race conditions of the four-mile National Hunt Chase Challenge Cup at Cheltenham on Wednesday week has resulted in a record entry announced yesterday of 61.
Alan Armstrong's Leemount Merlin has been well beaten in his last two runs but the recent improved race conditions will be in his favour tonight.