<s>
In	O
computing	O
,	O
a	O
process	O
is	O
the	O
instance	O
of	O
a	O
computer	B-Application
program	I-Application
that	O
is	O
being	O
executed	O
by	O
one	O
or	O
many	O
threads	B-Operating_System
.	O
</s>
<s>
There	O
are	O
many	O
different	O
process	O
models	O
,	O
some	O
of	O
which	O
are	O
light	O
weight	O
,	O
but	O
almost	O
all	O
processes	O
(	O
even	O
entire	O
virtual	B-Architecture
machines	I-Architecture
)	O
are	O
rooted	O
in	O
an	O
operating	B-General_Concept
system	I-General_Concept
(	O
OS	O
)	O
process	O
which	O
comprises	O
the	O
program	B-Application
code	O
,	O
assigned	O
system	B-General_Concept
resources	I-General_Concept
,	O
physical	O
and	O
logical	O
access	O
permissions	O
,	O
and	O
data	O
structures	O
to	O
initiate	O
,	O
control	O
and	O
coordinate	O
execution	O
activity	O
.	O
</s>
<s>
Depending	O
on	O
the	O
OS	O
,	O
a	O
process	O
may	O
be	O
made	O
up	O
of	O
multiple	O
threads	B-Operating_System
of	O
execution	O
that	O
execute	O
instructions	B-General_Concept
concurrently	B-Operating_System
.	O
</s>
<s>
While	O
a	O
computer	B-Application
program	I-Application
is	O
a	O
passive	O
collection	O
of	O
instructions	B-General_Concept
typically	O
stored	O
in	O
a	O
file	O
on	O
disk	O
,	O
a	O
process	O
is	O
the	O
execution	O
of	O
those	O
instructions	B-General_Concept
after	O
being	O
loaded	O
from	O
the	O
disk	O
into	O
memory	O
.	O
</s>
<s>
Several	O
processes	O
may	O
be	O
associated	O
with	O
the	O
same	O
program	B-Application
;	O
for	O
example	O
,	O
opening	O
up	O
several	O
instances	O
of	O
the	O
same	O
program	B-Application
often	O
results	O
in	O
more	O
than	O
one	O
process	O
being	O
executed	O
.	O
</s>
<s>
Multitasking	B-Operating_System
is	O
a	O
method	O
to	O
allow	O
multiple	O
processes	O
to	O
share	O
processors	B-General_Concept
(	O
CPUs	O
)	O
and	O
other	O
system	B-General_Concept
resources	I-General_Concept
.	O
</s>
<s>
Each	O
CPU	B-General_Concept
(	O
core	O
)	O
executes	O
a	O
single	O
process	O
at	O
a	O
time	O
.	O
</s>
<s>
However	O
,	O
multitasking	B-Operating_System
allows	O
each	O
processor	B-General_Concept
to	O
switch	B-Operating_System
between	O
tasks	O
that	O
are	O
being	O
executed	O
without	O
having	O
to	O
wait	B-Operating_System
for	O
each	O
task	O
to	O
finish	O
(	O
preemption	B-Operating_System
)	O
.	O
</s>
<s>
Depending	O
on	O
the	O
operating	B-General_Concept
system	I-General_Concept
implementation	O
,	O
switches	O
could	O
be	O
performed	O
when	O
tasks	O
initiate	O
and	O
wait	B-Operating_System
for	O
completion	O
of	O
input/output	B-General_Concept
operations	O
,	O
when	O
a	O
task	O
voluntarily	O
yields	O
the	O
CPU	B-General_Concept
,	O
on	O
hardware	O
interrupts	B-Application
,	O
and	O
when	O
the	O
operating	B-General_Concept
system	I-General_Concept
scheduler	O
decides	O
that	O
a	O
process	O
has	O
expired	O
its	O
fair	O
share	O
of	O
CPU	B-General_Concept
time	O
(	O
e.g	O
,	O
by	O
the	O
Completely	B-Application
Fair	I-Application
Scheduler	I-Application
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
)	O
.	O
</s>
<s>
A	O
common	O
form	O
of	O
multitasking	B-Operating_System
is	O
provided	O
by	O
CPU	B-General_Concept
's	O
time-sharing	B-General_Concept
that	O
is	O
a	O
method	O
for	O
interleaving	O
the	O
execution	O
of	O
users	O
 '	O
processes	O
and	O
threads	B-Operating_System
,	O
and	O
even	O
of	O
independent	O
kernel	B-Operating_System
tasks	O
–	O
although	O
the	O
latter	O
feature	O
is	O
feasible	O
only	O
in	O
preemptive	O
kernels	B-Operating_System
such	O
as	O
Linux	B-Operating_System
.	O
</s>
<s>
Preemption	B-Operating_System
has	O
an	O
important	O
side	O
effect	O
for	O
interactive	O
processes	O
that	O
are	O
given	O
higher	O
priority	O
with	O
respect	O
to	O
CPU	B-General_Concept
bound	O
processes	O
,	O
therefore	O
users	O
are	O
immediately	O
assigned	O
computing	B-General_Concept
resources	I-General_Concept
at	O
the	O
simple	O
pressing	O
of	O
a	O
key	O
or	O
when	O
moving	O
a	O
mouse	O
.	O
</s>
<s>
In	O
time-sharing	B-General_Concept
systems	I-General_Concept
,	O
context	B-Operating_System
switches	I-Operating_System
are	O
performed	O
rapidly	O
,	O
which	O
makes	O
it	O
seem	O
like	O
multiple	O
processes	O
are	O
being	O
executed	O
simultaneously	O
on	O
the	O
same	O
processor	B-General_Concept
.	O
</s>
<s>
This	O
seemingly-simultaneous	O
execution	O
of	O
multiple	O
processes	O
is	O
called	O
concurrency	B-Operating_System
.	O
</s>
<s>
For	O
security	O
and	O
reliability	O
,	O
most	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
prevent	O
direct	O
communication	B-Operating_System
between	O
independent	O
processes	O
,	O
providing	O
strictly	O
mediated	O
and	O
controlled	O
inter-process	B-Operating_System
communication	I-Operating_System
.	O
</s>
<s>
In	O
general	O
,	O
a	O
computer	O
system	B-Operating_System
process	I-Operating_System
consists	O
of	O
(	O
or	O
is	O
said	O
to	O
own	O
)	O
the	O
following	O
resources	O
:	O
</s>
<s>
An	O
image	O
of	O
the	O
executable	O
machine	B-Language
code	I-Language
associated	O
with	O
a	O
program	B-Application
.	O
</s>
<s>
Memory	O
(	O
typically	O
some	O
region	O
of	O
virtual	B-Architecture
memory	I-Architecture
)	O
;	O
which	O
includes	O
the	O
executable	O
code	O
,	O
process-specific	O
data	O
(	O
input	B-General_Concept
and	I-General_Concept
output	I-General_Concept
)	O
,	O
a	O
call	B-General_Concept
stack	I-General_Concept
(	O
to	O
keep	O
track	O
of	O
active	O
subroutines	O
and/or	O
other	O
events	O
)	O
,	O
and	O
a	O
heap	O
to	O
hold	O
intermediate	O
computation	O
data	O
generated	O
during	O
run	O
time	O
.	O
</s>
<s>
Operating	B-General_Concept
system	I-General_Concept
descriptors	O
of	O
resources	O
that	O
are	O
allocated	O
to	O
the	O
process	O
,	O
such	O
as	O
file	B-Application
descriptors	I-Application
(	O
Unix	B-Application
terminology	O
)	O
or	O
handles	O
(	O
Windows	B-Application
)	O
,	O
and	O
data	O
sources	O
and	O
sinks	O
.	O
</s>
<s>
Processor	B-General_Concept
state	O
(	O
context	B-Operating_System
)	O
,	O
such	O
as	O
the	O
content	O
of	O
registers	B-General_Concept
and	O
physical	O
memory	O
addressing	O
.	O
</s>
<s>
The	O
state	O
is	O
typically	O
stored	O
in	O
computer	O
registers	B-General_Concept
when	O
the	O
process	O
is	O
executing	B-General_Concept
,	O
and	O
in	O
memory	O
otherwise	O
.	O
</s>
<s>
The	O
operating	B-General_Concept
system	I-General_Concept
holds	O
most	O
of	O
this	O
information	O
about	O
active	O
processes	O
in	O
data	O
structures	O
called	O
process	B-Operating_System
control	I-Operating_System
blocks	I-Operating_System
.	O
</s>
<s>
Any	O
subset	O
of	O
the	O
resources	O
,	O
typically	O
at	O
least	O
the	O
processor	B-General_Concept
state	O
,	O
may	O
be	O
associated	O
with	O
each	O
of	O
the	O
process	O
 '	O
threads	B-Operating_System
in	O
operating	B-General_Concept
systems	I-General_Concept
that	O
support	O
threads	B-Operating_System
or	O
child	O
processes	O
.	O
</s>
<s>
The	O
operating	B-General_Concept
system	I-General_Concept
keeps	O
its	O
processes	O
separate	O
and	O
allocates	O
the	O
resources	O
they	O
need	O
,	O
so	O
that	O
they	O
are	O
less	O
likely	O
to	O
interfere	O
with	O
each	O
other	O
and	O
cause	O
system	O
failures	O
(	O
e.g.	O
,	O
deadlock	B-Operating_System
or	O
thrashing	B-General_Concept
)	O
.	O
</s>
<s>
The	O
operating	B-General_Concept
system	I-General_Concept
may	O
also	O
provide	O
mechanisms	O
for	O
inter-process	B-Operating_System
communication	I-Operating_System
to	O
enable	O
processes	O
to	O
interact	O
in	O
safe	O
and	O
predictable	O
ways	O
.	O
</s>
<s>
A	O
multitasking	B-Operating_System
operating	I-Operating_System
system	I-Operating_System
may	O
just	O
switch	B-Operating_System
between	O
processes	O
to	O
give	O
the	O
appearance	O
of	O
many	O
processes	O
executing	B-General_Concept
simultaneously	O
(	O
that	O
is	O
,	O
in	O
parallel	B-Operating_System
)	O
,	O
though	O
in	O
fact	O
only	O
one	O
process	O
can	O
be	O
executing	B-General_Concept
at	O
any	O
one	O
time	O
on	O
a	O
single	O
CPU	B-General_Concept
(	O
unless	O
the	O
CPU	B-General_Concept
has	O
multiple	O
cores	O
,	O
then	O
multithreading	B-Operating_System
or	O
other	O
similar	O
technologies	O
can	O
be	O
used	O
)	O
.	O
</s>
<s>
It	O
is	O
usual	O
to	O
associate	O
a	O
single	O
process	O
with	O
a	O
main	O
program	B-Application
,	O
and	O
child	O
processes	O
with	O
any	O
spin-off	O
,	O
parallel	B-Operating_System
processes	O
,	O
which	O
behave	O
like	O
asynchronous	B-Operating_System
subroutines	O
.	O
</s>
<s>
A	O
process	O
is	O
said	O
to	O
own	O
resources	O
,	O
of	O
which	O
an	O
image	O
of	O
its	O
program	B-Application
(	O
in	O
memory	O
)	O
is	O
one	O
such	O
resource	B-General_Concept
.	O
</s>
<s>
However	O
,	O
in	O
multiprocessing	B-Operating_System
systems	O
many	O
processes	O
may	O
run	O
off	O
of	O
,	O
or	O
share	O
,	O
the	O
same	O
reentrant	B-Operating_System
program	I-Operating_System
at	O
the	O
same	O
location	O
in	O
memory	O
,	O
but	O
each	O
process	O
is	O
said	O
to	O
own	O
its	O
own	O
image	O
of	O
the	O
program	B-Application
.	O
</s>
<s>
Processes	O
are	O
often	O
called	O
"	O
tasks	O
"	O
in	O
embedded	B-Architecture
operating	B-General_Concept
systems	I-General_Concept
.	O
</s>
<s>
The	O
above	O
description	O
applies	O
to	O
both	O
processes	O
managed	O
by	O
an	O
operating	B-General_Concept
system	I-General_Concept
,	O
and	O
processes	O
as	O
defined	O
by	O
process	O
calculi	O
.	O
</s>
<s>
If	O
a	O
process	O
requests	O
something	O
for	O
which	O
it	O
must	O
wait	B-Operating_System
,	O
it	O
will	O
be	O
blocked	O
.	O
</s>
<s>
When	O
the	O
process	O
is	O
in	O
the	O
blocked	B-Operating_System
state	I-Operating_System
,	O
it	O
is	O
eligible	O
for	O
swapping	O
to	O
disk	O
,	O
but	O
this	O
is	O
transparent	O
in	O
a	O
virtual	B-Architecture
memory	I-Architecture
system	O
,	O
where	O
regions	O
of	O
a	O
process	O
's	O
memory	O
may	O
be	O
really	O
on	O
disk	O
and	O
not	O
in	O
main	O
memory	O
at	O
any	O
time	O
.	O
</s>
<s>
Even	O
portions	O
of	O
active	O
processes/tasks	O
(	O
executing	B-General_Concept
programs	O
)	O
are	O
eligible	O
for	O
swapping	O
to	O
disk	O
,	O
if	O
the	O
portions	O
have	O
not	O
been	O
used	O
recently	O
.	O
</s>
<s>
Not	O
all	O
parts	O
of	O
an	O
executing	B-General_Concept
program	B-Application
and	O
its	O
data	O
have	O
to	O
be	O
in	O
physical	O
memory	O
for	O
the	O
associated	O
process	O
to	O
be	O
active	O
.	O
</s>
<s>
An	O
operating	B-Operating_System
system	I-Operating_System
kernel	I-Operating_System
that	O
allows	O
multitasking	B-Operating_System
needs	O
processes	O
to	O
have	O
certain	B-Operating_System
states	I-Operating_System
.	O
</s>
<s>
First	O
,	O
the	O
process	O
is	O
"	O
created	O
"	O
by	O
being	O
loaded	O
from	O
a	O
secondary	O
storage	O
device	O
(	O
hard	B-Device
disk	I-Device
drive	I-Device
,	O
CD-ROM	B-Device
,	O
etc	O
.	O
)	O
</s>
<s>
While	O
the	O
process	O
is	O
"	O
waiting	O
"	O
,	O
it	O
waits	O
for	O
the	O
scheduler	O
to	O
do	O
a	O
so-called	O
context	B-Operating_System
switch	I-Operating_System
.	O
</s>
<s>
The	O
context	B-Operating_System
switch	I-Operating_System
loads	O
the	O
process	O
into	O
the	O
processor	B-General_Concept
and	O
changes	O
the	O
state	O
to	O
"	O
running	O
"	O
while	O
the	O
previously	O
"	O
running	O
"	O
process	O
is	O
stored	O
in	O
a	O
"	O
waiting	O
"	O
state	O
.	O
</s>
<s>
If	O
a	O
process	O
in	O
the	O
"	O
running	O
"	O
state	O
needs	O
to	O
wait	B-Operating_System
for	O
a	O
resource	B-General_Concept
(	O
wait	B-Operating_System
for	O
user	B-General_Concept
input	I-General_Concept
or	O
file	O
to	O
open	O
,	O
for	O
example	O
)	O
,	O
it	O
is	O
assigned	O
the	O
"	O
blocked	O
"	O
state	O
.	O
</s>
<s>
The	O
process	B-Operating_System
state	I-Operating_System
is	O
changed	O
back	O
to	O
"	O
waiting	O
"	O
when	O
the	O
process	O
no	O
longer	O
needs	O
to	O
wait	B-Operating_System
(	O
in	O
a	O
blocked	B-Operating_System
state	I-Operating_System
)	O
.	O
</s>
<s>
Once	O
the	O
process	O
finishes	O
execution	O
,	O
or	O
is	O
terminated	O
by	O
the	O
operating	B-General_Concept
system	I-General_Concept
,	O
it	O
is	O
no	O
longer	O
needed	O
.	O
</s>
<s>
When	O
processes	O
need	O
to	O
communicate	O
with	O
each	O
other	O
they	O
must	O
share	O
parts	O
of	O
their	O
address	B-General_Concept
spaces	I-General_Concept
or	O
use	O
other	O
forms	O
of	O
inter-process	B-Operating_System
communication	I-Operating_System
(	O
IPC	O
)	O
.	O
</s>
<s>
For	O
instance	O
in	O
a	O
shell	O
pipeline	O
,	O
the	O
output	O
of	O
the	O
first	O
process	O
need	O
to	O
pass	O
to	O
the	O
second	O
one	O
,	O
and	O
so	O
on	O
;	O
another	O
example	O
is	O
a	O
task	O
that	O
can	O
be	O
decomposed	O
into	O
cooperating	O
but	O
partially	O
independent	O
processes	O
which	O
can	O
run	O
at	O
once	O
(	O
i.e.	O
,	O
using	O
concurrency	B-Operating_System
,	O
or	O
true	O
parallelism	B-Operating_System
–	O
the	O
latter	O
model	O
is	O
a	O
particular	O
case	O
of	O
concurrent	B-Operating_System
execution	O
and	O
is	O
feasible	O
whenever	O
enough	O
CPU	B-Architecture
cores	I-Architecture
are	O
available	O
for	O
all	O
the	O
processes	O
that	O
are	O
ready	O
to	O
run	O
)	O
.	O
</s>
<s>
It	O
is	O
even	O
possible	O
for	O
two	O
or	O
more	O
processes	O
to	O
be	O
running	O
on	O
different	O
machines	O
that	O
may	O
run	O
different	O
operating	B-General_Concept
system	I-General_Concept
(	O
OS	O
)	O
,	O
therefore	O
some	O
mechanisms	O
for	O
communication	B-Operating_System
and	O
synchronization	O
(	O
called	O
communications	O
protocols	O
for	O
distributed	O
computing	O
)	O
are	O
needed	O
(	O
e.g.	O
,	O
the	O
Message	B-Application
Passing	I-Application
Interface	I-Application
,	O
often	O
simply	O
called	O
MPI	B-Application
)	O
.	O
</s>
<s>
By	O
the	O
early	O
1960s	O
,	O
computer	O
control	O
software	O
had	O
evolved	O
from	O
monitor	O
control	O
software	O
,	O
for	O
example	O
IBSYS	B-Operating_System
,	O
to	O
executive	O
control	O
software	O
.	O
</s>
<s>
Over	O
time	O
,	O
computers	O
got	O
faster	O
while	O
computer	B-General_Concept
time	I-General_Concept
was	O
still	O
neither	O
cheap	O
nor	O
fully	O
utilized	O
;	O
such	O
an	O
environment	O
made	O
multiprogramming	O
possible	O
and	O
necessary	O
.	O
</s>
<s>
Multiprogramming	O
means	O
that	O
several	O
programs	O
run	O
concurrently	B-Operating_System
.	O
</s>
<s>
At	O
first	O
,	O
more	O
than	O
one	O
program	B-Application
ran	O
on	O
a	O
single	O
processor	B-General_Concept
,	O
as	O
a	O
result	O
of	O
underlying	O
uniprocessor	B-Operating_System
computer	O
architecture	O
,	O
and	O
they	O
shared	O
scarce	O
and	O
limited	O
hardware	O
resources	O
;	O
consequently	O
,	O
the	O
concurrency	B-Operating_System
was	O
of	O
a	O
serial	O
nature	O
.	O
</s>
<s>
On	O
later	O
systems	O
with	O
multiple	B-Operating_System
processors	I-Operating_System
,	O
multiple	O
programs	O
may	O
run	O
concurrently	B-Operating_System
in	O
parallel	B-Operating_System
.	O
</s>
<s>
Programs	O
consist	O
of	O
sequences	O
of	O
instructions	B-General_Concept
for	O
processors	B-General_Concept
.	O
</s>
<s>
A	O
single	O
processor	B-General_Concept
can	O
run	O
only	O
one	O
instruction	O
at	O
a	O
time	O
:	O
it	O
is	O
impossible	O
to	O
run	O
more	O
programs	O
at	O
the	O
same	O
time	O
.	O
</s>
<s>
A	O
program	B-Application
might	O
need	O
some	O
resource	B-General_Concept
,	O
such	O
as	O
an	O
input	O
device	O
,	O
which	O
has	O
a	O
large	O
delay	O
,	O
or	O
a	O
program	B-Application
might	O
start	O
some	O
slow	O
operation	O
,	O
such	O
as	O
sending	O
output	O
to	O
a	O
printer	O
.	O
</s>
<s>
This	O
would	O
lead	O
to	O
processor	B-General_Concept
being	O
"	O
idle	O
"	O
(	O
unused	O
)	O
.	O
</s>
<s>
To	O
keep	O
the	O
processor	B-General_Concept
busy	O
at	O
all	O
times	O
,	O
the	O
execution	O
of	O
such	O
a	O
program	B-Application
is	O
halted	O
and	O
the	O
operating	B-General_Concept
system	I-General_Concept
switches	O
the	O
processor	B-General_Concept
to	O
run	O
another	O
program	B-Application
.	O
</s>
<s>
To	O
the	O
user	O
,	O
it	O
will	O
appear	O
that	O
the	O
programs	O
run	O
at	O
the	O
same	O
time	O
(	O
hence	O
the	O
term	O
"	O
parallel	B-Operating_System
"	O
)	O
.	O
</s>
<s>
Shortly	O
thereafter	O
,	O
the	O
notion	O
of	O
a	O
"	O
program	B-Application
"	O
was	O
expanded	O
to	O
the	O
notion	O
of	O
an	O
"	O
executing	B-General_Concept
program	B-Application
and	O
its	O
context	B-Operating_System
"	O
.	O
</s>
<s>
The	O
concept	O
of	O
a	O
process	O
was	O
born	O
,	O
which	O
also	O
became	O
necessary	O
with	O
the	O
invention	O
of	O
re-entrant	B-Operating_System
code	I-Operating_System
.	O
</s>
<s>
Threads	B-Operating_System
came	O
somewhat	O
later	O
.	O
</s>
<s>
However	O
,	O
with	O
the	O
advent	O
of	O
concepts	O
such	O
as	O
time-sharing	B-General_Concept
,	O
computer	B-Architecture
networks	I-Architecture
,	O
and	O
multiple-CPU	O
shared	B-Operating_System
memory	I-Operating_System
computers	O
,	O
the	O
old	O
"	O
multiprogramming	O
"	O
gave	O
way	O
to	O
true	O
multitasking	B-Operating_System
,	O
multiprocessing	B-Operating_System
and	O
,	O
later	O
,	O
multithreading	B-Operating_System
.	O
</s>
