<s>
A	O
race	B-Operating_System
condition	I-Operating_System
or	O
race	B-Operating_System
hazard	I-Operating_System
is	O
the	O
condition	O
of	O
an	O
electronics	O
,	O
software	O
,	O
or	O
other	O
system	O
where	O
the	O
system	O
's	O
substantive	O
behavior	O
is	O
dependent	O
on	O
the	O
sequence	O
or	O
timing	O
of	O
other	O
uncontrollable	O
events	O
.	O
</s>
<s>
It	O
becomes	O
a	O
bug	B-Error_Name
when	O
one	O
or	O
more	O
of	O
the	O
possible	O
behaviors	O
is	O
undesirable	O
.	O
</s>
<s>
The	O
term	O
race	B-Operating_System
condition	I-Operating_System
was	O
already	O
in	O
use	O
by	O
1954	O
,	O
for	O
example	O
in	O
David	O
A	O
.	O
Huffman	O
's	O
doctoral	O
thesis	O
"	O
The	O
synthesis	O
of	O
sequential	O
switching	O
circuits	O
"	O
.	O
</s>
<s>
Race	B-Operating_System
conditions	I-Operating_System
can	O
occur	O
especially	O
in	O
logic	O
circuits	O
,	O
multithreaded	B-Operating_System
,	O
or	O
distributed	B-Architecture
software	I-Architecture
programs	O
.	O
</s>
<s>
A	O
typical	O
example	O
of	O
a	O
race	B-Operating_System
condition	I-Operating_System
may	O
occur	O
when	O
a	O
logic	O
gate	O
combines	O
signals	O
that	O
have	O
traveled	O
along	O
different	O
paths	O
from	O
the	O
same	O
source	O
.	O
</s>
<s>
Certain	O
systems	O
can	O
tolerate	O
such	O
glitches	B-Error_Name
but	O
if	O
this	O
output	O
functions	O
as	O
a	O
clock	O
signal	O
for	O
further	O
systems	O
that	O
contain	O
memory	O
,	O
for	O
example	O
,	O
the	O
system	O
can	O
rapidly	O
depart	O
from	O
its	O
designed	O
behaviour	O
(	O
in	O
effect	O
,	O
the	O
temporary	O
glitch	B-Error_Name
becomes	O
a	O
permanent	O
glitch	B-Error_Name
)	O
.	O
</s>
<s>
A	O
critical	O
race	B-Operating_System
condition	I-Operating_System
occurs	O
when	O
the	O
order	O
in	O
which	O
internal	O
variables	O
are	O
changed	O
determines	O
the	O
eventual	O
state	O
that	O
the	O
state	B-Architecture
machine	I-Architecture
will	O
end	O
up	O
in	O
.	O
</s>
<s>
A	O
non-critical	O
race	B-Operating_System
condition	I-Operating_System
occurs	O
when	O
the	O
order	O
in	O
which	O
internal	O
variables	O
are	O
changed	O
does	O
not	O
determine	O
the	O
eventual	O
state	O
that	O
the	O
state	B-Architecture
machine	I-Architecture
will	O
end	O
up	O
in	O
.	O
</s>
<s>
A	O
static	O
race	B-Operating_System
condition	I-Operating_System
occurs	O
when	O
a	O
signal	O
and	O
its	O
complement	O
are	O
combined	O
.	O
</s>
<s>
A	O
dynamic	O
race	B-Operating_System
condition	I-Operating_System
occurs	O
when	O
it	O
results	O
in	O
multiple	O
transitions	O
when	O
only	O
one	O
is	O
intended	O
.	O
</s>
<s>
An	O
essential	O
race	B-Operating_System
condition	I-Operating_System
occurs	O
when	O
an	O
input	O
has	O
two	O
transitions	O
in	O
less	O
than	O
the	O
total	O
feedback	O
propagation	O
time	O
.	O
</s>
<s>
Design	O
techniques	O
such	O
as	O
Karnaugh	O
maps	O
encourage	O
designers	O
to	O
recognize	O
and	O
eliminate	O
race	B-Operating_System
conditions	I-Operating_System
before	O
they	O
cause	O
problems	O
.	O
</s>
<s>
A	O
race	B-Operating_System
condition	I-Operating_System
can	O
arise	O
in	O
software	O
when	O
a	O
computer	O
program	O
has	O
multiple	O
code	O
paths	O
that	O
are	O
executing	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
If	O
the	O
multiple	O
code	O
paths	O
take	O
a	O
different	O
amount	O
of	O
time	O
than	O
expected	O
,	O
they	O
can	O
finish	O
in	O
a	O
different	O
order	O
than	O
expected	O
,	O
which	O
can	O
cause	O
software	B-Error_Name
bugs	I-Error_Name
due	O
to	O
unanticipated	O
behavior	O
.	O
</s>
<s>
Critical	O
race	B-Operating_System
conditions	I-Operating_System
cause	O
invalid	O
execution	O
and	O
software	B-Error_Name
bugs	I-Error_Name
.	O
</s>
<s>
Critical	O
race	B-Operating_System
conditions	I-Operating_System
often	O
happen	O
when	O
the	O
processes	O
or	O
threads	B-Operating_System
depend	O
on	O
some	O
shared	O
state	O
.	O
</s>
<s>
Operations	O
upon	O
shared	O
states	O
are	O
done	O
in	O
critical	B-Operating_System
sections	I-Operating_System
that	O
must	O
be	O
mutually	B-Operating_System
exclusive	I-Operating_System
.	O
</s>
<s>
A	O
data	O
race	O
is	O
a	O
type	O
of	O
race	B-Operating_System
condition	I-Operating_System
.	O
</s>
<s>
Data	O
races	O
are	O
important	O
parts	O
of	O
various	O
formal	O
memory	B-General_Concept
models	I-General_Concept
.	O
</s>
<s>
The	O
memory	B-General_Concept
model	I-General_Concept
defined	O
in	O
the	O
C11	O
and	O
C++11	B-Language
standards	O
specify	O
that	O
a	O
C	O
or	O
C++	O
program	O
containing	O
a	O
data	O
race	O
has	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
A	O
race	B-Operating_System
condition	I-Operating_System
can	O
be	O
difficult	O
to	O
reproduce	O
and	O
debug	O
because	O
the	O
end	O
result	O
is	O
nondeterministic	O
and	O
depends	O
on	O
the	O
relative	O
timing	O
between	O
interfering	O
threads	B-Operating_System
.	O
</s>
<s>
A	O
bug	B-Error_Name
that	O
disappears	O
like	O
this	O
during	O
debugging	O
attempts	O
is	O
often	O
referred	O
to	O
as	O
a	O
"	O
Heisenbug	O
"	O
.	O
</s>
<s>
It	O
is	O
therefore	O
better	O
to	O
avoid	O
race	B-Operating_System
conditions	I-Operating_System
by	O
careful	O
software	O
design	O
.	O
</s>
<s>
Assume	O
that	O
two	O
threads	B-Operating_System
each	O
increment	O
the	O
value	O
of	O
a	O
global	O
integer	O
variable	O
by	O
1	O
.	O
</s>
<s>
However	O
,	O
if	O
the	O
two	O
threads	B-Operating_System
run	O
simultaneously	O
without	O
locking	O
or	O
synchronization	O
(	O
via	O
semaphores	B-Operating_System
)	O
,	O
the	O
outcome	O
of	O
the	O
operation	O
could	O
be	O
wrong	O
.	O
</s>
<s>
This	O
occurs	O
because	O
here	O
the	O
increment	O
operations	O
are	O
not	O
mutually	B-Operating_System
exclusive	I-Operating_System
.	O
</s>
<s>
Mutually	B-Operating_System
exclusive	I-Operating_System
operations	O
are	O
those	O
that	O
cannot	O
be	O
interrupted	O
while	O
accessing	O
some	O
resource	O
such	O
as	O
a	O
memory	O
location	O
.	O
</s>
<s>
Not	O
all	O
regard	O
data	O
races	O
as	O
a	O
subset	O
of	O
race	B-Operating_System
conditions	I-Operating_System
.	O
</s>
<s>
The	O
precise	O
definition	O
of	O
data	O
race	O
is	O
specific	O
to	O
the	O
formal	O
concurrency	O
model	O
being	O
used	O
,	O
but	O
typically	O
it	O
refers	O
to	O
a	O
situation	O
where	O
a	O
memory	O
operation	O
in	O
one	O
thread	B-Operating_System
could	O
potentially	O
attempt	O
to	O
access	O
a	O
memory	O
location	O
at	O
the	O
same	O
time	O
that	O
a	O
memory	O
operation	O
in	O
another	O
thread	B-Operating_System
is	O
writing	O
to	O
that	O
memory	O
location	O
,	O
in	O
a	O
context	O
where	O
this	O
is	O
dangerous	O
.	O
</s>
<s>
This	O
implies	O
that	O
a	O
data	O
race	O
is	O
different	O
from	O
a	O
race	B-Operating_System
condition	I-Operating_System
as	O
it	O
is	O
possible	O
to	O
have	O
nondeterminism	O
due	O
to	O
timing	O
even	O
in	O
a	O
program	O
without	O
data	O
races	O
,	O
for	O
example	O
,	O
in	O
a	O
program	O
in	O
which	O
all	O
memory	O
accesses	O
use	O
only	O
atomic	B-General_Concept
operations	I-General_Concept
.	O
</s>
<s>
This	O
can	O
be	O
dangerous	O
because	O
on	O
many	O
platforms	O
,	O
if	O
two	O
threads	B-Operating_System
write	O
to	O
a	O
memory	O
location	O
at	O
the	O
same	O
time	O
,	O
it	O
may	O
be	O
possible	O
for	O
the	O
memory	O
location	O
to	O
end	O
up	O
holding	O
a	O
value	O
that	O
is	O
some	O
arbitrary	O
and	O
meaningless	O
combination	O
of	O
the	O
bits	O
representing	O
the	O
values	O
that	O
each	O
thread	B-Operating_System
was	O
attempting	O
to	O
write	O
;	O
this	O
could	O
result	O
in	O
memory	O
corruption	O
if	O
the	O
resulting	O
value	O
is	O
one	O
that	O
neither	O
thread	B-Operating_System
attempted	O
to	O
write	O
(	O
sometimes	O
this	O
is	O
called	O
a	O
'	O
torn	O
write	O
 '	O
)	O
.	O
</s>
<s>
Similarly	O
,	O
if	O
one	O
thread	B-Operating_System
reads	O
from	O
a	O
location	O
while	O
another	O
thread	B-Operating_System
is	O
writing	O
to	O
it	O
,	O
it	O
may	O
be	O
possible	O
for	O
the	O
read	O
to	O
return	O
a	O
value	O
that	O
is	O
some	O
arbitrary	O
and	O
meaningless	O
combination	O
of	O
the	O
bits	O
representing	O
the	O
value	O
that	O
the	O
memory	O
location	O
held	O
before	O
the	O
write	O
,	O
and	O
of	O
the	O
bits	O
representing	O
the	O
value	O
being	O
written	O
.	O
</s>
<s>
This	O
is	O
probably	O
why	O
the	O
term	O
is	O
data	O
race	O
;	O
on	O
many	O
platforms	O
,	O
where	O
there	O
is	O
a	O
race	B-Operating_System
condition	I-Operating_System
involving	O
only	O
synchronization	O
operations	O
,	O
such	O
a	O
race	O
may	O
be	O
nondeterministic	O
but	O
otherwise	O
safe	O
;	O
but	O
a	O
data	O
race	O
could	O
lead	O
to	O
memory	O
corruption	O
or	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
Any	O
such	O
data	O
race	O
results	O
in	O
undefined	B-Language
behavior	I-Language
.	O
</s>
<s>
"	O
Two	O
memory	O
operations	O
,	O
x	O
and	O
y	O
,	O
in	O
a	O
sequentially	B-General_Concept
consistent	I-General_Concept
execution	O
form	O
a	O
race	O
〈x	O
,	O
y〉	O
,	O
iff	O
x	O
and	O
y	O
conflict	O
,	O
and	O
they	O
are	O
not	O
ordered	O
by	O
the	O
hb1	O
relation	O
of	O
the	O
execution	O
.	O
</s>
<s>
The	O
hb1	O
relation	O
is	O
defined	O
elsewhere	O
in	O
the	O
paper	O
,	O
and	O
is	O
an	O
example	O
of	O
a	O
typical	O
"	O
happens-before	B-Operating_System
"	O
relation	O
;	O
intuitively	O
,	O
if	O
we	O
can	O
prove	O
that	O
we	O
are	O
in	O
a	O
situation	O
where	O
one	O
memory	O
operation	O
X	O
is	O
guaranteed	O
to	O
be	O
executed	O
to	O
completion	O
before	O
another	O
memory	O
operation	O
Y	O
begins	O
,	O
then	O
we	O
say	O
that	O
"	O
X	O
happens-before	B-Operating_System
Y	O
"	O
.	O
</s>
<s>
If	O
neither	O
"	O
X	O
happens-before	B-Operating_System
Y	O
"	O
nor	O
"	O
Y	O
happens-before	B-Operating_System
X	O
"	O
,	O
then	O
we	O
say	O
that	O
X	O
and	O
Y	O
are	O
"	O
not	O
ordered	O
by	O
the	O
hb1	O
relation	O
"	O
.	O
</s>
<s>
Two	O
accesses	O
to	O
(	O
reads	O
of	O
or	O
writes	O
to	O
)	O
the	O
same	O
variable	O
are	O
said	O
to	O
be	O
conflicting	O
if	O
at	O
least	O
one	O
of	O
the	O
accesses	O
is	O
a	O
write	O
...	O
When	O
a	O
program	O
contains	O
two	O
conflicting	O
accesses	O
( §	O
17.4.1	O
)	O
that	O
are	O
not	O
ordered	O
by	O
a	O
happens-before	B-Operating_System
relationship	O
,	O
it	O
is	O
said	O
to	O
contain	O
a	O
data	O
race	O
...	O
a	O
data	O
race	O
cannot	O
cause	O
incorrect	O
behavior	O
such	O
as	O
returning	O
the	O
wrong	O
length	O
for	O
an	O
array	O
.	O
</s>
<s>
A	O
critical	O
difference	O
between	O
the	O
C++	O
approach	O
and	O
the	O
Java	O
approach	O
is	O
that	O
in	O
C++	O
,	O
a	O
data	O
race	O
is	O
undefined	B-Language
behavior	I-Language
,	O
whereas	O
in	O
Java	O
,	O
a	O
data	O
race	O
merely	O
affects	O
"	O
inter-thread	O
actions	O
"	O
.	O
</s>
<s>
An	O
important	O
facet	O
of	O
data	O
races	O
is	O
that	O
in	O
some	O
contexts	O
,	O
a	O
program	O
that	O
is	O
free	O
of	O
data	O
races	O
is	O
guaranteed	O
to	O
execute	O
in	O
a	O
sequentially	B-General_Concept
consistent	I-General_Concept
manner	O
,	O
greatly	O
easing	O
reasoning	O
about	O
the	O
concurrent	O
behavior	O
of	O
the	O
program	O
.	O
</s>
<s>
Formal	O
memory	B-General_Concept
models	I-General_Concept
that	O
provide	O
such	O
a	O
guarantee	O
are	O
said	O
to	O
exhibit	O
an	O
"	O
SC	O
for	O
DRF	O
"	O
(	O
Sequential	B-General_Concept
Consistency	I-General_Concept
for	O
Data	O
Race	O
Freedom	O
)	O
property	O
.	O
</s>
<s>
This	O
approach	O
has	O
been	O
said	O
to	O
have	O
achieved	O
recent	O
consensus	O
(	O
presumably	O
compared	O
to	O
approaches	O
which	O
guarantee	O
sequential	B-General_Concept
consistency	I-General_Concept
in	O
all	O
cases	O
,	O
or	O
approaches	O
which	O
do	O
not	O
guarantee	O
it	O
at	O
all	O
)	O
.	O
</s>
<s>
A	O
program	O
is	O
correctly	O
synchronized	O
if	O
and	O
only	O
if	O
all	O
sequentially	B-General_Concept
consistent	I-General_Concept
executions	O
are	O
free	O
of	O
data	O
races	O
.	O
</s>
<s>
If	O
a	O
program	O
is	O
correctly	O
synchronized	O
,	O
then	O
all	O
executions	O
of	O
the	O
program	O
will	O
appear	O
to	O
be	O
sequentially	B-General_Concept
consistent	I-General_Concept
( §	O
17.4.3	O
)	O
.	O
</s>
<s>
[	O
Note:It	O
can	O
be	O
shown	O
that	O
programs	O
that	O
correctly	O
use	O
mutexes	B-Operating_System
and	O
memory_order_seq_cst	O
operations	O
to	O
prevent	O
all	O
data	O
races	O
and	O
use	O
no	O
other	O
synchronization	O
operations	O
behave	O
as	O
if	O
the	O
operations	O
executed	O
by	O
their	O
constituent	O
threads	B-Operating_System
were	O
simply	O
interleaved	O
,	O
with	O
each	O
value	O
computation	O
of	O
an	O
object	O
being	O
taken	O
from	O
the	O
last	O
side	O
effect	O
on	O
that	O
object	O
in	O
that	O
interleaving	O
.	O
</s>
<s>
This	O
is	O
normally	O
referred	O
to	O
as	O
“	O
sequential	B-General_Concept
consistency	I-General_Concept
”	O
.	O
</s>
<s>
However	O
,	O
this	O
applies	O
only	O
to	O
data-race-free	O
programs	O
,	O
and	O
data-race-free	O
programs	O
cannot	O
observe	O
most	O
program	O
transformations	O
that	O
do	O
not	O
change	O
single-threaded	B-Operating_System
program	O
semantics	O
.	O
</s>
<s>
In	O
other	O
words	O
,	O
in	O
C++	O
,	O
some	O
correct	O
programs	O
are	O
not	O
sequentially	B-General_Concept
consistent	I-General_Concept
.	O
</s>
<s>
There	O
are	O
various	O
theorems	O
,	O
often	O
provided	O
in	O
the	O
form	O
of	O
memory	B-General_Concept
models	I-General_Concept
,	O
that	O
provide	O
SC	O
for	O
DRF	O
guarantees	O
given	O
various	O
contexts	O
.	O
</s>
<s>
The	O
premises	O
of	O
these	O
theorems	O
typically	O
place	O
constraints	O
upon	O
both	O
the	O
memory	B-General_Concept
model	I-General_Concept
(	O
and	O
therefore	O
upon	O
the	O
implementation	O
)	O
,	O
and	O
also	O
upon	O
the	O
programmer	O
;	O
that	O
is	O
to	O
say	O
,	O
typically	O
it	O
is	O
the	O
case	O
that	O
there	O
are	O
programs	O
which	O
do	O
not	O
meet	O
the	O
premises	O
of	O
the	O
theorem	O
and	O
which	O
could	O
not	O
be	O
guaranteed	O
to	O
execute	O
in	O
a	O
sequentially	B-General_Concept
consistent	I-General_Concept
manner	O
.	O
</s>
<s>
The	O
DRF1	O
memory	B-General_Concept
model	I-General_Concept
provides	O
SC	O
for	O
DRF	O
and	O
allows	O
the	O
optimizations	O
of	O
the	O
WO	O
(	O
weak	O
ordering	O
)	O
,	O
RCsc	O
(	O
Release	B-General_Concept
Consistency	I-General_Concept
with	O
sequentially	B-General_Concept
consistent	I-General_Concept
special	O
operations	O
)	O
,	O
VAX	O
memory	B-General_Concept
model	I-General_Concept
,	O
and	O
data-race-free-0	O
memory	B-General_Concept
models	I-General_Concept
.	O
</s>
<s>
The	O
PLpc	O
memory	B-General_Concept
model	I-General_Concept
provides	O
SC	O
for	O
DRF	O
and	O
allows	O
the	O
optimizations	O
of	O
the	O
TSO	O
(	O
Total	O
Store	O
Order	O
)	O
,	O
PSO	O
,	O
PC	O
(	O
Processor	B-General_Concept
Consistency	I-General_Concept
)	O
,	O
and	O
RCpc	O
(	O
Release	B-General_Concept
Consistency	I-General_Concept
with	O
processor	B-General_Concept
consistency	I-General_Concept
special	O
operations	O
)	O
models	O
.	O
</s>
<s>
Many	O
software	O
race	B-Operating_System
conditions	I-Operating_System
have	O
associated	O
computer	O
security	O
implications	O
.	O
</s>
<s>
A	O
race	B-Operating_System
condition	I-Operating_System
allows	O
an	O
attacker	O
with	O
access	O
to	O
a	O
shared	B-General_Concept
resource	I-General_Concept
to	O
cause	O
other	O
actors	O
that	O
utilize	O
that	O
resource	O
to	O
malfunction	O
,	O
resulting	O
in	O
effects	O
including	O
denial	O
of	O
service	O
and	O
privilege	O
escalation	O
.	O
</s>
<s>
A	O
specific	O
kind	O
of	O
race	B-Operating_System
condition	I-Operating_System
involves	O
checking	O
for	O
a	O
predicate	O
(	O
e.g.	O
</s>
<s>
When	O
this	O
kind	O
of	O
bug	B-Error_Name
exists	O
in	O
security-sensitive	O
code	O
,	O
a	O
security	O
vulnerability	O
called	O
a	O
time-of-check-to-time-of-use	B-Error_Name
(	O
TOCTTOU	B-Error_Name
)	O
bug	B-Error_Name
is	O
created	O
.	O
</s>
<s>
Race	B-Operating_System
conditions	I-Operating_System
are	O
also	O
intentionally	O
used	O
to	O
create	O
hardware	O
random	O
number	O
generators	O
and	O
physically	O
unclonable	O
functions	O
.	O
</s>
<s>
By	O
measuring	O
each	O
manufactured	O
circuit	O
's	O
specific	O
set	O
of	O
race	B-Operating_System
condition	I-Operating_System
outcomes	O
,	O
a	O
profile	O
can	O
be	O
collected	O
for	O
each	O
circuit	O
and	O
kept	O
secret	O
in	O
order	O
to	O
later	O
verify	O
a	O
circuit	O
's	O
identity	O
.	O
</s>
<s>
File	B-Application
locking	I-Application
provides	O
a	O
commonly	O
used	O
solution	O
.	O
</s>
<s>
A	O
more	O
cumbersome	O
remedy	O
involves	O
organizing	O
the	O
system	O
in	O
such	O
a	O
way	O
that	O
one	O
unique	O
process	O
(	O
running	O
a	O
daemon	B-Operating_System
or	O
the	O
like	O
)	O
has	O
exclusive	O
access	O
to	O
the	O
file	O
,	O
and	O
all	O
other	O
processes	O
that	O
need	O
to	O
access	O
the	O
data	O
in	O
that	O
file	O
do	O
so	O
only	O
via	O
interprocess	O
communication	O
with	O
that	O
one	O
process	O
.	O
</s>
<s>
A	O
different	O
form	O
of	O
race	B-Operating_System
condition	I-Operating_System
exists	O
in	O
file	O
systems	O
where	O
unrelated	O
programs	O
may	O
affect	O
each	O
other	O
by	O
suddenly	O
using	O
up	O
available	O
resources	O
such	O
as	O
disk	O
space	O
,	O
memory	O
space	O
,	O
or	O
processor	O
cycles	O
.	O
</s>
<s>
In	O
networking	O
,	O
consider	O
a	O
distributed	B-Architecture
chat	O
network	O
like	O
IRC	B-Protocol
,	O
where	O
a	O
user	O
who	O
starts	O
a	O
channel	O
automatically	O
acquires	O
channel-operator	O
privileges	O
.	O
</s>
<s>
(	O
This	O
problem	O
has	O
been	O
largely	O
solved	O
by	O
various	O
IRC	B-Protocol
server	O
implementations	O
.	O
)	O
</s>
<s>
In	O
this	O
case	O
of	O
a	O
race	B-Operating_System
condition	I-Operating_System
,	O
the	O
concept	O
of	O
the	O
"	O
shared	B-General_Concept
resource	I-General_Concept
"	O
covers	O
the	O
state	O
of	O
the	O
network	O
(	O
what	O
channels	O
exist	O
,	O
as	O
well	O
as	O
what	O
users	O
started	O
them	O
and	O
therefore	O
have	O
what	O
privileges	O
)	O
,	O
which	O
each	O
server	O
can	O
freely	O
change	O
as	O
long	O
as	O
it	O
signals	O
the	O
other	O
servers	O
on	O
the	O
network	O
about	O
the	O
changes	O
so	O
that	O
they	O
can	O
update	O
their	O
conception	O
of	O
the	O
state	O
of	O
the	O
network	O
.	O
</s>
<s>
However	O
,	O
the	O
latency	O
across	O
the	O
network	O
makes	O
possible	O
the	O
kind	O
of	O
race	B-Operating_System
condition	I-Operating_System
described	O
.	O
</s>
<s>
In	O
this	O
case	O
,	O
heading	O
off	O
race	B-Operating_System
conditions	I-Operating_System
by	O
imposing	O
a	O
form	O
of	O
control	O
over	O
access	O
to	O
the	O
shared	B-General_Concept
resource	I-General_Concept
—	O
say	O
,	O
appointing	O
one	O
server	O
to	O
control	O
who	O
holds	O
what	O
privileges	O
—	O
would	O
mean	O
turning	O
the	O
distributed	B-Architecture
network	O
into	O
a	O
centralized	O
one	O
(	O
at	O
least	O
for	O
that	O
one	O
part	O
of	O
the	O
network	O
operation	O
)	O
.	O
</s>
<s>
Race	B-Operating_System
conditions	I-Operating_System
can	O
also	O
exist	O
when	O
a	O
computer	O
program	O
is	O
written	O
with	O
non-blocking	O
sockets	O
,	O
in	O
which	O
case	O
the	O
performance	O
of	O
the	O
program	O
can	O
be	O
dependent	O
on	O
the	O
speed	O
of	O
the	O
network	O
link	O
.	O
</s>
<s>
Software	O
flaws	O
in	O
life-critical	B-Application
systems	I-Application
can	O
be	O
disastrous	O
.	O
</s>
<s>
Race	B-Operating_System
conditions	I-Operating_System
were	O
among	O
the	O
flaws	O
in	O
the	O
Therac-25	O
radiation	O
therapy	O
machine	O
,	O
which	O
led	O
to	O
the	O
death	O
of	O
at	O
least	O
three	O
patients	O
and	O
injuries	O
to	O
several	O
more	O
.	O
</s>
<s>
A	O
race	B-Operating_System
condition	I-Operating_System
existed	O
in	O
the	O
alarm	O
subsystem	O
;	O
when	O
three	O
sagging	O
power	O
lines	O
were	O
tripped	O
simultaneously	O
,	O
the	O
condition	O
prevented	O
alerts	O
from	O
being	O
raised	O
to	O
the	O
monitoring	O
technicians	O
,	O
delaying	O
their	O
awareness	O
of	O
the	O
problem	O
.	O
</s>
<s>
Many	O
software	O
tools	O
exist	O
to	O
help	O
detect	O
race	B-Operating_System
conditions	I-Operating_System
in	O
software	O
.	O
</s>
<s>
Thread	B-Operating_System
Safety	O
Analysis	O
is	O
a	O
static	O
analysis	O
tool	O
for	O
annotation-based	O
intra-procedural	O
static	O
analysis	O
,	O
originally	O
implemented	O
as	O
a	O
branch	O
of	O
gcc	O
,	O
and	O
now	O
reimplemented	O
in	O
Clang	B-Application
,	O
supporting	O
PThreads	O
.	O
</s>
<s>
Intel	B-General_Concept
Inspector	I-General_Concept
,	O
a	O
memory	O
and	O
thread	B-Operating_System
checking	O
and	O
debugging	O
tool	O
to	O
increase	O
the	O
reliability	O
,	O
security	O
,	O
and	O
accuracy	O
of	O
C/C	O
++	O
and	O
Fortran	O
applications	O
;	O
Intel	B-General_Concept
Advisor	I-General_Concept
,	O
a	O
sampling	O
based	O
,	O
SIMD	O
vectorization	O
optimization	O
and	O
shared	O
memory	O
threading	O
assistance	O
tool	O
for	O
C	O
,	O
C++	O
,	O
C#	O
,	O
and	O
Fortran	O
software	O
developers	O
and	O
architects	O
;	O
</s>
<s>
ThreadSanitizer	O
,	O
which	O
uses	O
binary	O
(	O
Valgrind-based	O
)	O
or	O
source	O
,	O
LLVM-based	O
instrumentation	O
,	O
and	O
supports	O
PThreads	O
)	O
;	O
and	O
Helgrind	O
,	O
a	O
Valgrind	B-Application
tool	O
for	O
detecting	O
synchronisation	O
errors	O
in	O
C	O
,	O
C++	O
and	O
Fortran	O
programs	O
that	O
use	O
the	O
POSIX	O
pthreads	O
threading	O
primitives	O
.	O
</s>
<s>
DataRaceBench	O
is	O
a	O
benchmark	O
suite	O
designed	O
to	O
systematically	O
and	O
quantitatively	O
evaluate	O
data	O
race	O
detection	O
tools	O
which	O
analyze	O
multi-threaded	B-Operating_System
applications	O
written	O
in	O
OpenMP	B-Application
.	O
</s>
<s>
Neuroscience	O
is	O
demonstrating	O
that	O
race	B-Operating_System
conditions	I-Operating_System
can	O
occur	O
in	O
mammal	O
brains	O
as	O
well	O
.	O
</s>
<s>
In	O
UK	O
railway	O
signalling	O
,	O
a	O
race	B-Operating_System
condition	I-Operating_System
would	O
arise	O
in	O
the	O
carrying	O
out	O
of	O
Rule	O
55	O
.	O
</s>
<s>
Modern	O
signalling	O
practice	O
removes	O
the	O
race	B-Operating_System
condition	I-Operating_System
by	O
making	O
it	O
possible	O
for	O
the	O
driver	O
to	O
instantaneously	O
contact	O
the	O
signal	O
box	O
by	O
radio	O
.	O
</s>
