<s>
In	O
a	O
multitasking	B-Operating_System
computer	O
system	O
,	O
processes	B-Operating_System
may	O
occupy	O
a	O
variety	O
of	O
states	B-Application
.	O
</s>
<s>
These	O
distinct	O
states	B-Application
may	O
not	O
be	O
recognized	O
as	O
such	O
by	O
the	O
operating	B-Operating_System
system	I-Operating_System
kernel	I-Operating_System
.	O
</s>
<s>
However	O
,	O
they	O
are	O
a	O
useful	O
abstraction	O
for	O
the	O
understanding	O
of	O
processes	B-Operating_System
.	O
</s>
<s>
The	O
following	O
typical	O
process	B-Operating_System
states	I-Operating_System
are	O
possible	O
on	O
computer	O
systems	O
of	O
all	O
kinds	O
.	O
</s>
<s>
In	O
most	O
of	O
these	O
states	B-Application
,	O
processes	B-Operating_System
are	O
"	O
stored	O
"	O
on	O
main	O
memory	O
.	O
</s>
<s>
Typically	O
in	O
most	O
desktop	B-Device
computer	I-Device
systems	O
,	O
this	O
admission	O
will	O
be	O
approved	O
automatically	O
.	O
</s>
<s>
However	O
,	O
for	O
real-time	B-Operating_System
operating	I-Operating_System
systems	I-Operating_System
this	O
admission	O
may	O
be	O
delayed	O
.	O
</s>
<s>
In	O
a	O
realtime	O
system	O
,	O
admitting	O
too	O
many	O
processes	B-Operating_System
to	O
the	O
"	O
ready	O
"	O
state	O
may	O
lead	O
to	O
oversaturation	O
and	O
overcontention	B-Architecture
of	O
the	O
system	O
's	O
resources	O
,	O
leading	O
to	O
an	O
inability	O
to	O
meet	O
process	O
deadlines	O
.	O
</s>
<s>
A	O
"	O
ready	O
"	O
or	O
"	O
waiting	O
"	O
process	O
has	O
been	O
loaded	O
into	O
main	O
memory	O
and	O
is	O
awaiting	O
execution	O
on	O
a	O
CPU	B-General_Concept
(	O
to	O
be	O
context	O
switched	O
onto	O
the	O
CPU	B-General_Concept
by	O
the	O
dispatcher	O
,	O
or	O
short-term	O
scheduler	O
)	O
.	O
</s>
<s>
There	O
may	O
be	O
many	O
"	O
ready	O
"	O
processes	B-Operating_System
at	O
any	O
one	O
point	O
of	O
the	O
system	O
's	O
execution	O
—	O
for	O
example	O
,	O
in	O
a	O
one-processor	O
system	O
,	O
only	O
one	O
process	O
can	O
be	O
executing	O
at	O
any	O
one	O
time	O
,	O
and	O
all	O
other	O
"	O
concurrently	O
executing	O
"	O
processes	B-Operating_System
will	O
be	O
waiting	O
for	O
execution	O
.	O
</s>
<s>
A	O
ready	O
queue	B-Application
or	O
run	B-Application
queue	I-Application
is	O
used	O
in	O
computer	O
scheduling	O
.	O
</s>
<s>
Modern	O
computers	O
are	O
capable	O
of	O
running	O
many	O
different	O
programs	O
or	O
processes	B-Operating_System
at	O
the	O
same	O
time	O
.	O
</s>
<s>
However	O
,	O
the	O
CPU	B-General_Concept
is	O
only	O
capable	O
of	O
handling	O
one	O
process	O
at	O
a	O
time	O
.	O
</s>
<s>
Processes	B-Operating_System
that	O
are	O
ready	O
for	O
the	O
CPU	B-General_Concept
are	O
kept	O
in	O
a	O
queue	B-Application
for	O
"	O
ready	O
"	O
processes	B-Operating_System
.	O
</s>
<s>
Other	O
processes	B-Operating_System
that	O
are	O
waiting	O
for	O
an	O
event	O
to	O
occur	O
,	O
such	O
as	O
loading	O
information	O
from	O
a	O
hard	B-Device
drive	I-Device
or	O
waiting	O
on	O
an	O
internet	O
connection	O
,	O
are	O
not	O
in	O
the	O
ready	O
queue	B-Application
.	O
</s>
<s>
There	O
is	O
at	O
most	O
one	O
running	O
process	O
per	O
CPU	B-General_Concept
or	O
core	O
.	O
</s>
<s>
A	O
process	O
can	O
run	O
in	O
either	O
of	O
the	O
two	O
modes	O
,	O
namely	O
kernel	B-Operating_System
mode	O
or	O
user	O
mode	O
.	O
</s>
<s>
Processes	B-Operating_System
in	O
kernel	B-Operating_System
mode	O
can	O
access	O
both	O
:	O
kernel	B-Operating_System
and	O
user	O
addresses	O
.	O
</s>
<s>
Kernel	B-Operating_System
mode	O
allows	O
unrestricted	O
access	O
to	O
hardware	O
including	O
execution	O
of	O
privileged	O
instructions	O
.	O
</s>
<s>
Various	O
instructions	O
(	O
such	O
as	O
I/O	B-General_Concept
instructions	O
and	O
halt	O
instructions	O
)	O
are	O
privileged	O
and	O
can	O
be	O
executed	O
only	O
in	O
kernel	B-Operating_System
mode	O
.	O
</s>
<s>
A	O
system	B-Operating_System
call	I-Operating_System
from	O
a	O
user	O
program	O
leads	O
to	O
a	O
switch	O
to	O
kernel	B-Operating_System
mode	O
.	O
</s>
<s>
Processes	B-Operating_System
in	O
user	O
mode	O
can	O
access	O
their	O
own	O
instructions	O
and	O
data	O
but	O
not	O
kernel	B-Operating_System
instructions	O
and	O
data	O
(	O
or	O
those	O
of	O
other	O
processes	B-Operating_System
)	O
.	O
</s>
<s>
However	O
,	O
when	O
a	O
user	O
application	O
requests	O
a	O
service	O
from	O
the	O
operating	B-General_Concept
system	I-General_Concept
(	O
via	O
a	O
system	B-Operating_System
call	I-Operating_System
)	O
,	O
the	O
system	O
must	O
transition	O
from	O
user	O
to	O
kernel	B-Operating_System
mode	O
to	O
fulfill	O
the	O
request	O
.	O
</s>
<s>
There	O
is	O
an	O
isolated	O
virtual	B-General_Concept
address	I-General_Concept
space	I-General_Concept
for	O
each	O
process	O
in	O
user	O
mode	O
.	O
</s>
<s>
User	O
mode	O
ensures	O
isolated	O
execution	O
of	O
each	O
process	O
so	O
that	O
it	O
does	O
not	O
affect	O
other	O
processes	B-Operating_System
as	O
such	O
.	O
</s>
<s>
A	O
process	O
transitions	O
to	O
a	O
blocked	B-Operating_System
state	O
when	O
it	O
cannot	O
carry	O
on	O
without	O
an	O
external	O
change	O
in	O
state	O
or	O
event	O
occurring	O
.	O
</s>
<s>
For	O
example	O
,	O
a	O
process	O
may	O
block	O
on	O
a	O
call	O
to	O
an	O
I/O	B-General_Concept
device	I-General_Concept
such	O
as	O
a	O
printer	O
,	O
if	O
the	O
printer	O
is	O
not	O
available	O
.	O
</s>
<s>
Processes	B-Operating_System
also	O
commonly	O
block	O
when	O
they	O
require	O
user	B-General_Concept
input	I-General_Concept
,	O
or	O
require	O
access	O
to	O
a	O
critical	B-Operating_System
section	I-Operating_System
which	O
must	O
be	O
executed	O
atomically	O
.	O
</s>
<s>
Such	O
critical	B-Operating_System
sections	I-Operating_System
are	O
protected	O
using	O
a	O
synchronization	O
object	O
such	O
as	O
a	O
semaphore	O
or	O
mutex	O
.	O
</s>
<s>
A	O
process	O
may	O
be	O
terminated	B-Operating_System
,	O
either	O
from	O
the	O
"	O
running	O
"	O
state	O
by	O
completing	O
its	O
execution	O
or	O
by	O
explicitly	O
being	O
killed	O
.	O
</s>
<s>
In	O
either	O
of	O
these	O
cases	O
,	O
the	O
process	O
moves	O
to	O
the	O
"	O
terminated	B-Operating_System
"	O
state	O
.	O
</s>
<s>
The	O
underlying	O
program	O
is	O
no	O
longer	O
executing	O
,	O
but	O
the	O
process	O
remains	O
in	O
the	O
process	B-Operating_System
table	I-Operating_System
as	O
a	O
zombie	B-Operating_System
process	I-Operating_System
until	O
its	O
parent	O
process	O
calls	O
the	O
wait	B-Operating_System
system	B-Operating_System
call	I-Operating_System
to	O
read	O
its	O
exit	B-Operating_System
status	I-Operating_System
,	O
at	O
which	O
point	O
the	O
process	O
is	O
removed	O
from	O
the	O
process	B-Operating_System
table	I-Operating_System
,	O
finally	O
ending	O
the	O
process	O
's	O
lifetime	O
.	O
</s>
<s>
If	O
the	O
parent	O
fails	O
to	O
call	O
wait	B-Operating_System
,	O
this	O
continues	O
to	O
consume	O
the	O
process	B-Operating_System
table	I-Operating_System
entry	O
(	O
concretely	O
the	O
process	B-Operating_System
identifier	I-Operating_System
or	O
PID	O
)	O
,	O
and	O
causes	O
a	O
resource	O
leak	O
.	O
</s>
<s>
Two	O
additional	O
states	B-Application
are	O
available	O
for	O
processes	B-Operating_System
in	O
systems	O
that	O
support	O
virtual	B-Architecture
memory	I-Architecture
.	O
</s>
<s>
In	O
both	O
of	O
these	O
states	B-Application
,	O
processes	B-Operating_System
are	O
"	O
stored	O
"	O
on	O
secondary	O
memory	O
(	O
typically	O
a	O
hard	B-Device
disk	I-Device
)	O
.	O
</s>
<s>
In	O
systems	O
that	O
support	O
virtual	B-Architecture
memory	I-Architecture
,	O
a	O
process	O
may	O
be	O
swapped	O
out	O
,	O
that	O
is	O
,	O
removed	O
from	O
main	O
memory	O
and	O
placed	O
on	O
external	O
storage	O
by	O
the	O
scheduler	O
.	O
</s>
<s>
(	O
Also	O
called	O
suspended	O
and	O
blocked	B-Operating_System
.	O
)	O
</s>
<s>
Processes	B-Operating_System
that	O
are	O
blocked	B-Operating_System
may	O
also	O
be	O
swapped	O
out	O
.	O
</s>
<s>
In	O
this	O
event	O
the	O
process	O
is	O
both	O
swapped	O
out	O
and	O
blocked	B-Operating_System
,	O
and	O
may	O
be	O
swapped	O
back	O
in	O
again	O
under	O
the	O
same	O
circumstances	O
as	O
a	O
swapped	O
out	O
and	O
waiting	O
process	O
(	O
although	O
in	O
this	O
case	O
,	O
the	O
process	O
will	O
move	O
to	O
the	O
blocked	B-Operating_System
state	O
,	O
and	O
may	O
still	O
be	O
waiting	O
for	O
a	O
resource	O
to	O
become	O
available	O
)	O
.	O
</s>
