<s>
The	O
cigarette	B-Operating_System
smokers	I-Operating_System
problem	I-Operating_System
is	O
a	O
concurrency	B-Architecture
problem	O
in	O
computer	B-General_Concept
science	I-General_Concept
,	O
originally	O
described	O
in	O
1971	O
by	O
Suhas	O
Patil	O
.	O
</s>
<s>
Three	O
semaphores	B-Operating_System
are	O
used	O
to	O
represent	O
the	O
items	O
on	O
the	O
table	O
;	O
the	O
agent	O
increases	O
the	O
appropriate	O
semaphore	B-Operating_System
to	O
signal	O
that	O
an	O
item	O
has	O
been	O
placed	O
on	O
the	O
table	O
,	O
and	O
smokers	O
decrement	O
the	O
semaphore	B-Operating_System
when	O
removing	O
items	O
.	O
</s>
<s>
Also	O
,	O
each	O
smoker	O
has	O
an	O
associated	O
semaphore	B-Operating_System
that	O
they	O
use	O
to	O
signal	O
to	O
the	O
agent	O
that	O
the	O
particular	O
smoker	O
is	O
done	O
smoking	O
;	O
the	O
agent	O
has	O
a	O
process	O
that	O
waits	O
on	O
each	O
smoker	O
's	O
semaphore	B-Operating_System
to	O
let	O
the	O
agent	O
know	O
that	O
it	O
can	O
place	O
the	O
new	O
items	O
on	O
the	O
table	O
.	O
</s>
<s>
A	O
simple	O
pseudocode	B-Language
implementation	O
of	O
the	O
smoker	O
who	O
has	O
the	O
supply	O
of	O
tobacco	O
might	O
look	O
like	O
the	O
following	O
:	O
</s>
<s>
The	O
solution	O
is	O
to	O
define	O
additional	O
processes	O
and	O
semaphores	B-Operating_System
that	O
prevent	O
deadlock	O
,	O
without	O
modifying	O
the	O
agent	O
.	O
</s>
<s>
Patil	O
placed	O
the	O
following	O
constraints	O
on	O
the	O
cigarette	B-Operating_System
smokers	I-Operating_System
problem	I-Operating_System
:	O
</s>
<s>
Patil	O
used	O
a	O
proof	O
in	O
terms	O
of	O
Petri	B-Operating_System
nets	I-Operating_System
to	O
claim	O
that	O
a	O
solution	O
to	O
the	O
cigarette	B-Operating_System
smokers	I-Operating_System
problem	I-Operating_System
using	O
Edsger	O
Dijkstra	O
's	O
semaphore	B-Operating_System
primitives	O
is	O
impossible	O
,	O
and	O
to	O
suggest	O
that	O
a	O
more	O
powerful	O
primitive	O
is	O
necessary	O
.	O
</s>
<s>
However	O
,	O
David	O
Parnas	O
demonstrated	O
that	O
Patil	O
's	O
proof	O
is	O
inadequate	O
if	O
arrays	O
of	O
semaphores	B-Operating_System
are	O
used	O
,	O
offering	O
a	O
solution	O
that	O
uses	O
helper	O
processes	O
that	O
do	O
arithmetic	O
to	O
signal	O
the	O
appropriate	O
smoker	O
to	O
proceed	O
.	O
</s>
<s>
According	O
to	O
Allen	O
B	O
.	O
Downey	O
,	O
the	O
first	O
restriction	O
makes	O
sense	O
,	O
because	O
if	O
the	O
agent	O
represents	O
an	O
operating	B-General_Concept
system	I-General_Concept
,	O
it	O
would	O
be	O
unreasonable	O
or	O
impossible	O
to	O
modify	O
it	O
every	O
time	O
a	O
new	O
application	O
came	O
along	O
.	O
</s>
<s>
In	O
this	O
author	O
's	O
opinion	O
,	O
restrictions	O
prohibiting	O
either	O
conditionals	O
or	O
semaphore	B-Operating_System
arrays	O
are	O
artificial	O
.	O
</s>
