<s>
Stackless	B-Operating_System
Python	I-Operating_System
,	O
or	O
Stackless	B-Operating_System
,	O
is	O
a	O
Python	B-Language
programming	I-Language
language	I-Language
interpreter	B-Application
,	O
so	O
named	O
because	O
it	O
avoids	O
depending	O
on	O
the	O
C	B-Language
call	B-General_Concept
stack	I-General_Concept
for	O
its	O
own	O
stack	O
.	O
</s>
<s>
In	O
practice	O
,	O
Stackless	B-Operating_System
Python	I-Operating_System
uses	O
the	O
C	B-Language
stack	O
,	O
but	O
the	O
stack	O
is	O
cleared	O
between	O
function	O
calls	O
.	O
</s>
<s>
The	O
most	O
prominent	O
feature	O
of	O
Stackless	B-Operating_System
is	O
microthreads	B-Operating_System
,	O
which	O
avoid	O
much	O
of	O
the	O
overhead	O
associated	O
with	O
usual	O
operating	O
system	O
threads	B-Operating_System
.	O
</s>
<s>
In	O
addition	O
to	O
Python	B-Language
features	O
,	O
Stackless	B-Operating_System
also	O
adds	O
support	O
for	O
coroutines	B-Architecture
,	O
communication	O
channels	B-Operating_System
,	O
and	O
task	O
serialization	B-Application
.	O
</s>
<s>
With	O
Stackless	B-Operating_System
Python	I-Operating_System
,	O
a	O
running	O
program	O
is	O
split	O
into	O
microthreads	B-Operating_System
that	O
are	O
managed	O
by	O
the	O
language	O
interpreter	B-Application
itself	O
,	O
not	O
the	O
operating	B-Operating_System
system	I-Operating_System
kernel	I-Operating_System
—	O
context	B-Operating_System
switching	I-Operating_System
and	O
task	O
scheduling	O
is	O
done	O
purely	O
in	O
the	O
interpreter	B-Application
(	O
these	O
are	O
thus	O
also	O
regarded	O
as	O
a	O
form	O
of	O
green	B-Operating_System
thread	I-Operating_System
)	O
.	O
</s>
<s>
Microthreads	B-Operating_System
manage	O
the	O
execution	O
of	O
different	O
subtasks	O
in	O
a	O
program	O
on	O
the	O
same	O
CPU	O
core	O
.	O
</s>
<s>
Thus	O
,	O
they	O
are	O
an	O
alternative	O
to	O
event-based	O
asynchronous	O
programming	O
and	O
also	O
avoid	O
the	O
overhead	O
of	O
using	O
separate	O
threads	B-Operating_System
for	O
single-core	O
programs	O
(	O
because	O
no	O
mode	O
switching	O
between	O
user	O
mode	O
and	O
kernel	B-Operating_System
mode	O
needs	O
to	O
be	O
done	O
,	O
so	O
CPU	O
usage	O
can	O
be	O
reduced	O
)	O
.	O
</s>
<s>
Although	O
microthreads	B-Operating_System
make	O
it	O
easier	O
to	O
deal	O
with	O
running	O
subtasks	O
on	O
a	O
single	O
core	O
,	O
Stackless	B-Operating_System
Python	I-Operating_System
does	O
not	O
remove	O
CPython	B-Language
's	O
Global	B-Operating_System
Interpreter	I-Operating_System
Lock	I-Operating_System
,	O
nor	O
does	O
it	O
use	O
multiple	O
threads	B-Operating_System
and/or	O
processes	O
.	O
</s>
<s>
So	O
it	O
allows	O
only	O
cooperative	B-Operating_System
multitasking	I-Operating_System
on	O
a	O
shared	O
CPU	O
and	O
not	O
parallelism	B-Operating_System
(	O
preemption	O
was	O
originally	O
not	O
available	O
but	O
is	O
now	O
in	O
some	O
form	O
)	O
.	O
</s>
<s>
To	O
use	O
multiple	O
CPU	O
cores	O
,	O
one	O
would	O
still	O
need	O
to	O
build	O
an	O
interprocess	O
communication	O
system	O
on	O
top	O
of	O
Stackless	B-Operating_System
Python	I-Operating_System
processes	O
.	O
</s>
<s>
Due	O
to	O
the	O
considerable	O
number	O
of	O
changes	O
in	O
the	O
source	O
,	O
Stackless	B-Operating_System
Python	I-Operating_System
cannot	O
be	O
installed	O
on	O
a	O
preexisting	O
Python	B-Language
installation	O
as	O
an	O
extension	B-Application
or	O
library	B-Library
.	O
</s>
<s>
It	O
is	O
instead	O
a	O
complete	O
Python	B-Language
distribution	O
in	O
itself	O
.	O
</s>
<s>
The	O
majority	O
of	O
Stackless	B-Operating_System
's	O
features	O
have	O
also	O
been	O
implemented	O
in	O
PyPy	B-Language
,	O
a	O
self-hosting	O
Python	B-Language
interpreter	B-Application
and	O
JIT	O
compiler	O
.	O
</s>
<s>
Although	O
the	O
whole	O
Stackless	B-Operating_System
is	O
a	O
separate	O
distribution	O
,	O
its	O
switching	O
functionality	O
has	O
been	O
successfully	O
packaged	O
as	O
a	O
CPython	B-Language
extension	B-Application
called	O
greenlet	O
.	O
</s>
<s>
gevent	O
)	O
to	O
provide	O
a	O
green	B-Operating_System
threading	I-Operating_System
solution	O
for	O
CPython	B-Language
.	O
</s>
<s>
Python	B-Language
since	O
has	O
received	O
a	O
native	O
solution	O
for	O
green	B-Operating_System
threads	I-Operating_System
:	O
await/async	O
.	O
</s>
<s>
Stackless	B-Operating_System
is	O
used	O
extensively	O
in	O
the	O
implementation	O
of	O
the	O
Eve	B-Protocol
Online	I-Protocol
massively	O
multiplayer	O
online	O
game	O
as	O
well	O
as	O
in	O
IronPort	O
's	O
mail	O
platform	O
.	O
</s>
