<s>
In	O
modern	O
computers	O
many	O
processes	B-Operating_System
run	O
at	O
once	O
.	O
</s>
<s>
Active	O
processes	B-Operating_System
are	O
placed	O
in	O
an	O
array	O
called	O
a	O
run	B-Application
queue	I-Application
,	O
or	O
runqueue	O
.	O
</s>
<s>
The	O
run	B-Application
queue	I-Application
may	O
contain	O
priority	O
values	O
for	O
each	O
process	O
,	O
which	O
will	O
be	O
used	O
by	O
the	O
scheduler	O
to	O
determine	O
which	O
process	O
to	O
run	O
next	O
.	O
</s>
<s>
To	O
ensure	O
each	O
program	O
has	O
a	O
fair	O
share	O
of	O
resources	O
,	O
each	O
one	O
is	O
run	O
for	O
some	O
time	O
period	O
(	O
quantum	O
)	O
before	O
it	O
is	O
paused	O
and	O
placed	O
back	O
into	O
the	O
run	B-Application
queue	I-Application
.	O
</s>
<s>
When	O
a	O
program	O
is	O
stopped	O
to	O
let	O
another	O
run	O
,	O
the	O
program	O
with	O
the	O
highest	O
priority	O
in	O
the	O
run	B-Application
queue	I-Application
is	O
then	O
allowed	O
to	O
execute	O
.	O
</s>
<s>
Processes	B-Operating_System
are	O
also	O
removed	O
from	O
the	O
run	B-Application
queue	I-Application
when	O
they	O
ask	O
to	O
sleep	O
,	O
are	O
waiting	O
on	O
a	O
resource	O
to	O
become	O
available	O
,	O
or	O
have	O
been	O
terminated	O
.	O
</s>
<s>
In	O
the	O
Linux	B-Application
operating	I-Application
system	I-Application
(	O
prior	O
to	O
kernel	O
2.6.23	O
)	O
,	O
each	O
CPU	O
in	O
the	O
system	O
is	O
given	O
a	O
run	B-Application
queue	I-Application
,	O
which	O
maintains	O
both	O
an	O
active	O
and	O
expired	O
array	O
of	O
processes	B-Operating_System
.	O
</s>
<s>
Each	O
array	O
contains	O
140	O
(	O
one	O
for	O
each	O
priority	O
level	O
)	O
pointers	O
to	O
doubly	B-Data_Structure
linked	I-Data_Structure
lists	I-Data_Structure
,	O
which	O
in	O
turn	O
reference	O
all	O
processes	B-Operating_System
with	O
the	O
given	O
priority	O
.	O
</s>
<s>
When	O
the	O
active	O
array	O
contains	O
no	O
more	O
processes	B-Operating_System
,	O
the	O
scheduler	O
swaps	O
the	O
active	O
and	O
expired	O
arrays	O
,	O
hence	O
the	O
name	O
O(1 )	O
scheduler	O
.	O
</s>
<s>
In	O
UNIX	B-Application
or	O
Linux	B-Application
,	O
the	O
sar	B-Application
command	O
is	O
used	O
to	O
check	O
the	O
run	B-Application
queue	I-Application
.	O
</s>
<s>
The	O
vmstat	B-Device
UNIX	B-Application
or	O
Linux	B-Application
command	O
can	O
also	O
be	O
used	O
to	O
determine	O
the	O
number	O
of	O
processes	B-Operating_System
that	O
are	O
queued	O
to	O
run	O
or	O
waiting	O
to	O
run	O
.	O
</s>
