13
gcd(x, y)
send(c, m)
- send message m
along channel c
,
usually abbreviated c!m
receive(c, m)
- receive message m
from channel c
,
usually abbreviated c?m
skip
process does nothing and terminates
c?m -> P
- a process that receives message m
from channel
c
and then behaves like process P
c!m -> P
- a process that sends message m
to channel
c
and then behaves like process P
c?m -> P
or c?m -> P
is called
a communication-enabled processe
P ; Q
- a process that behaves like process P
and then
process Q
P || Q
- a process that behaves like processes P and Q running
in parallel
P [] Q
- a process that behaves like process P or process Q, but
not both
P
and Q
are communication-enabled processes
swapper: input?one -> input?two -> output!two -> output!one -> swapper
B
is true and C
is ready, exchange messages and execute S
if
or a do
allows choice
merge: ( ( left?x -> skip [] right?x -> skip ) ; output!x ) -> merge
locked_mutex unlock?x -> lock?x -> locked_mutex unlocked_mutex lock?x -> unlock?x -> unlocked_mutex
db_empty() enter?reader() -> enter!ok() -> reader_in_db(1) || enter?writer() -> enter!ok() -> writer_in_db() reader_in_db(cnt) enter?reader() -> enter!ok() -> reader_in_db(cnt + 1) || enter?writer() -> reader_in_db_writer_waiting(cnt) exit?reader() -> if cnt == 1 db_empty() else reader_in_db(cnt - 1) writer_in_db() exit?writer -> db_empty() reader_in_db_writer_waiting() exit?reader() -> if cnt == 1 enter!ok() -> db_empty() else reader_in_db_writer_waiting(cnt - 1)
This page last modified on 15 August 2002.