<s>
JCSP	B-Language
is	O
an	O
implementation	O
of	O
communicating	O
sequential	O
processes	O
(	O
CSP	O
)	O
for	O
the	O
programming	O
language	O
Java	B-Language
.	O
</s>
<s>
Although	O
CSP	O
is	O
a	O
mathematical	O
system	O
,	O
JCSP	B-Language
does	O
not	O
require	O
in-depth	O
mathematical	O
skill	O
,	O
allowing	O
instead	O
that	O
programmers	O
can	O
achieve	O
well-behaved	O
software	O
by	O
following	O
simple	O
rules	O
.	O
</s>
<s>
CSP	O
allows	O
this	O
to	O
be	O
done	O
using	O
mathematics	O
and	O
JCSP	B-Language
allows	O
it	O
to	O
be	O
done	O
pragmatically	O
in	O
Java	B-Language
programs	O
.	O
</s>
<s>
Fortunately	O
,	O
JCSP	B-Language
does	O
not	O
force	O
its	O
users	O
to	O
adopt	O
a	O
mathematical	O
approach	O
themselves	O
,	O
but	O
allows	O
them	O
to	O
benefit	O
from	O
the	O
mathematics	O
that	O
underpins	O
the	O
library	O
.	O
</s>
<s>
Note	O
that	O
the	O
CSP	O
term	O
process	O
is	O
used	O
essentially	O
as	O
a	O
synonym	O
for	O
thread	O
in	O
Java	B-Language
parlance	O
;	O
a	O
process	O
in	O
CSP	O
is	O
a	O
lightweight	O
unit	O
of	O
execution	O
that	O
interacts	O
with	O
the	O
outside	O
world	O
via	O
events	O
and	O
is	O
an	O
active	O
component	O
that	O
encapsulates	O
the	O
data	O
structures	O
on	O
which	O
it	O
operates	O
.	O
</s>
<s>
The	O
benefit	O
is	O
that	O
each	O
thread	O
can	O
broadly	O
be	O
considered	O
to	O
be	O
a	O
"	O
single-threaded	O
"	O
entity	O
during	O
its	O
design	O
,	O
sparing	O
the	O
developer	O
from	O
the	O
uncertainties	O
of	O
whether	O
and	O
where	O
to	O
use	O
Java	B-Language
's	O
synchronized	O
keyword	O
,	O
and	O
at	O
the	O
same	O
time	O
guaranteeing	O
freedom	O
from	O
race	B-Operating_System
conditions	I-Operating_System
.	O
</s>
<s>
JCSP	B-Language
provides	O
for	O
clear	O
principles	O
for	O
designing	O
the	O
inter-thread	O
communication	O
in	O
a	O
way	O
that	O
is	O
provably	O
free	O
from	O
deadlock	B-Operating_System
.	O
</s>
<s>
There	O
is	O
a	O
clear	O
similarity	O
between	O
some	O
classes	O
in	O
the	O
standard	O
Java	B-Language
API	O
(	O
)	O
and	O
some	O
in	O
JCSP	B-Language
.	O
</s>
<s>
JCSP	B-Language
's	O
channel	O
classes	O
are	O
similar	O
to	O
the	O
BlockingQueue	O
.	O
</s>
<s>
There	O
is	O
one	O
important	O
difference	O
:	O
JCSP	B-Language
also	O
provides	O
an	O
class	O
to	O
allow	O
selection	O
between	O
inputs	O
;	O
this	O
capability	O
is	O
absent	O
from	O
the	O
standard	O
Java	B-Language
API	O
.	O
</s>
<s>
was	O
proven	O
to	O
operate	O
correctly	O
by	O
exhaustive	O
mathematical	O
analysis	O
of	O
its	O
state	O
space	O
,	O
guaranteeing	O
it	O
can	O
never	O
in	O
itself	O
cause	O
a	O
deadlock	B-Operating_System
.	O
</s>
<s>
As	O
such	O
,	O
it	O
epitomises	O
the	O
dependability	O
of	O
JCSP	B-Language
from	O
its	O
mathematical	O
basis	O
.	O
</s>
<s>
Because	O
Transmission	B-Protocol
Control	I-Protocol
Protocol	I-Protocol
(	O
TCP	O
)	O
sockets	O
can	O
be	O
constructed	O
to	O
behave	O
as	O
blocking	O
channels	O
in	O
the	O
CSP	O
sense	O
,	O
it	O
is	O
possible	O
to	O
distribute	O
JCSP	B-Language
processes	O
across	O
multiple	O
computers	O
.	O
</s>
<s>
This	O
is	O
achieved	O
using	O
the	O
JCSP	B-Language
Net	O
extension	O
that	O
provides	O
channels	O
with	O
CSP	O
semantics	O
using	O
TCP	O
.	O
</s>
<s>
JCSP	B-Language
re	O
is	O
a	O
highly	O
reduced	O
version	O
of	O
the	O
JCSP	B-Language
packages	O
developed	O
around	O
2008	O
at	O
the	O
Napier	O
University	O
Edinburgh	O
by	O
Professor	O
Jon	O
Kerridge	O
,	O
Alex	O
Panayotopoulos	O
and	O
Patrick	O
Lismore	O
.	O
</s>
<s>
Research	O
into	O
JCSP	B-Language
for	O
robotics	O
environments	O
and	O
JCSP	B-Language
for	O
mobile	O
environments	O
is	O
an	O
active	O
area	O
of	O
research	O
at	O
Napier	O
University	O
Edinburgh	O
.	O
</s>
<s>
The	O
working	O
implementation	O
of	O
'	O
JCSP	B-Language
re	O
 '	O
allows	O
the	O
development	O
of	O
the	O
same	O
concurrent	O
software	O
for	O
robots	O
.	O
</s>
<s>
Specifically	O
,	O
the	O
robots	O
targeted	O
for	O
this	O
research	O
were	O
the	O
Lego	B-Application
Mindstorms	I-Application
NXTs	I-Application
because	O
they	O
can	O
run	O
the	O
popular	O
LeJOS	B-Language
NXJ	O
virtual	O
machine	O
that	O
executes	O
Java	B-Language
source	I-Language
code	I-Language
.	O
</s>
<s>
JCSP	B-Language
is	O
essentially	O
a	O
pure-Java	O
API	O
(	O
although	O
a	O
research	O
alternative	O
exists	O
that	O
uses	O
the	O
C-CSP	O
extension	O
to	O
the	O
JVM	O
)	O
.	O
</s>
<s>
As	O
such	O
,	O
it	O
is	O
in	O
principle	O
eminently	O
suitable	O
for	O
concurrency	O
in	O
Scala	B-Application
and	O
Groovy	B-Application
applications	O
as	O
well	O
as	O
Java	B-Language
ones	O
.	O
</s>
<s>
JCSP	B-Language
can	O
therefore	O
provide	O
an	O
alternative	O
to	O
Scala	B-Application
's	O
actor	B-Application
model	I-Application
.	O
</s>
<s>
JCSP	B-Language
uses	O
synchronised	O
communication	O
and	O
actors	O
use	O
buffered	O
(	O
asynchronous	O
)	O
communication	O
,	O
each	O
of	O
which	O
have	O
their	O
advantages	O
in	O
certain	O
circumstances	O
.	O
</s>
<s>
JCSP	B-Language
allows	O
its	O
channels	O
to	O
be	O
buffered	O
so	O
can	O
easily	O
emulate	O
the	O
actor	B-Application
model	I-Application
;	O
the	O
converse	O
is	O
not	O
true	O
.	O
</s>
