<s>
Cooperative	B-Operating_System
multitasking	I-Operating_System
,	O
also	O
known	O
as	O
non-preemptive	B-Operating_System
multitasking	I-Operating_System
,	O
is	O
a	O
style	O
of	O
computer	B-Operating_System
multitasking	I-Operating_System
in	O
which	O
the	O
operating	B-General_Concept
system	I-General_Concept
never	O
initiates	O
a	O
context	B-Operating_System
switch	I-Operating_System
from	O
a	O
running	O
process	B-Operating_System
to	O
another	O
process	B-Operating_System
.	O
</s>
<s>
Instead	O
,	O
in	O
order	O
to	O
run	O
multiple	O
applications	O
concurrently	O
,	O
processes	O
voluntarily	O
yield	B-Language
control	I-Language
periodically	O
or	O
when	O
idle	O
or	O
logically	O
blocked	O
.	O
</s>
<s>
This	O
type	O
of	O
multitasking	B-Operating_System
is	O
called	O
cooperative	O
because	O
all	O
programs	O
must	O
cooperate	O
for	O
the	O
scheduling	O
scheme	O
to	O
work	O
.	O
</s>
<s>
In	O
this	O
scheme	O
,	O
the	O
process	B-Operating_System
scheduler	O
of	O
an	O
operating	B-General_Concept
system	I-General_Concept
is	O
known	O
as	O
a	O
cooperative	B-Operating_System
scheduler	I-Operating_System
whose	O
role	O
is	O
limited	O
to	O
starting	O
the	O
processes	O
and	O
letting	O
them	O
return	O
control	O
back	O
to	O
it	O
voluntarily	O
.	O
</s>
<s>
Although	O
it	O
is	O
rarely	O
used	O
as	O
the	O
primary	O
scheduling	O
mechanism	O
in	O
modern	O
operating	B-General_Concept
systems	I-General_Concept
,	O
it	O
is	O
widely	O
used	O
in	O
memory-constrained	O
embedded	B-Architecture
systems	I-Architecture
and	O
also	O
,	O
in	O
specific	O
applications	O
such	O
as	O
CICS	B-Application
or	O
the	O
JES2	B-Application
subsystem	O
.	O
</s>
<s>
Cooperative	B-Operating_System
multitasking	I-Operating_System
was	O
the	O
primary	O
scheduling	O
scheme	O
for	O
16-bit	O
applications	O
employed	O
by	O
Microsoft	B-Application
Windows	I-Application
before	O
Windows	O
95	O
and	O
Windows	O
NT	O
,	O
and	O
by	O
the	O
classic	O
Mac	O
OS	O
.	O
</s>
<s>
Windows	O
9x	O
used	O
non-preemptive	B-Operating_System
multitasking	I-Operating_System
for	O
16-bit	O
legacy	O
applications	O
,	O
and	O
the	O
PowerPC	B-Architecture
Versions	O
of	O
Mac	O
OSX	O
prior	O
to	O
Leopard	B-Application
used	O
it	O
for	O
classic	O
applications	O
.	O
</s>
<s>
NetWare	B-Operating_System
,	O
which	O
is	O
a	O
network-oriented	O
operating	B-General_Concept
system	I-General_Concept
,	O
used	O
cooperative	B-Operating_System
multitasking	I-Operating_System
up	O
to	O
NetWare6.5	O
.	O
</s>
<s>
Cooperative	B-Operating_System
multitasking	I-Operating_System
is	O
still	O
used	O
on	O
RISC	O
OS	O
systems	O
.	O
</s>
<s>
Cooperative	B-Operating_System
multitasking	I-Operating_System
is	O
used	O
with	O
await	O
in	O
languages	O
,	O
such	O
as	O
JavaScript	B-Language
or	O
Python	B-Language
,	O
that	O
feature	O
a	O
single-threaded	O
event-loop	O
in	O
their	O
runtime	O
.	O
</s>
<s>
This	O
contrasts	O
with	O
operating	B-General_Concept
system	I-General_Concept
cooperative	B-Operating_System
multitasking	I-Operating_System
as	O
await	O
is	O
scoped	O
only	O
to	O
the	O
function	O
or	O
block	O
,	O
meaning	O
other	O
tasks	O
may	O
run	O
concurrently	O
in	O
other	O
parts	O
of	O
the	O
code	O
while	O
a	O
single	O
function	O
is	O
waiting	O
.	O
</s>
<s>
In	O
most	O
modern	O
languages	O
,	O
async	O
and	O
await	O
are	O
implemented	O
as	O
coroutines	B-Architecture
.	O
</s>
<s>
As	O
a	O
cooperatively	O
multitasked	O
system	O
relies	O
on	O
each	O
process	B-Operating_System
regularly	O
giving	O
up	O
time	O
to	O
other	O
processes	O
on	O
the	O
system	O
,	O
one	O
poorly	O
designed	O
program	O
can	O
consume	O
all	O
of	O
the	O
CPU	O
time	O
for	O
itself	O
,	O
either	O
by	O
performing	O
extensive	O
calculations	O
or	O
by	O
busy	B-Operating_System
waiting	I-Operating_System
;	O
both	O
would	O
cause	O
the	O
whole	O
system	O
to	O
hang	B-General_Concept
.	O
</s>
<s>
In	O
a	O
server	B-Application
environment	O
,	O
this	O
is	O
a	O
hazard	O
that	O
makes	O
the	O
entire	O
environment	O
unacceptably	O
fragile	O
.	O
</s>
<s>
In	O
contrast	O
,	O
preemptive	B-Operating_System
multitasking	B-Operating_System
interrupts	O
applications	O
and	O
gives	O
control	O
to	O
other	O
processes	O
outside	O
the	O
application	O
's	O
control	O
.	O
</s>
<s>
The	O
potential	O
for	O
system	O
hang	B-General_Concept
can	O
be	O
alleviated	O
by	O
using	O
a	O
watchdog	B-Application
timer	I-Application
,	O
often	O
implemented	O
in	O
hardware	O
;	O
this	O
typically	O
invokes	O
a	O
hardware	B-Operating_System
reset	I-Operating_System
.	O
</s>
<s>
Cooperative	B-Operating_System
multitasking	I-Operating_System
allows	O
much	O
simpler	O
implementation	O
of	O
applications	O
because	O
their	O
execution	O
is	O
never	O
unexpectedly	O
interrupted	O
by	O
the	O
process	B-Operating_System
scheduler	O
;	O
for	O
example	O
,	O
various	O
functions	O
inside	O
the	O
application	O
do	O
not	O
need	O
to	O
be	O
reentrant	B-Operating_System
.	O
</s>
