Send Close Add comments: (status displays here)
Got it!  This site "robinsnyder.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website.  Note: This appears on each machine/browser from which this site is accessed.
Parallel programming using CSP
by RS  admin@robinsnyder.com : 1024 x 640


1. Parallel programming using CSP
CSP (Communicating Sequential Processes) is a notation for describing parallel programming.

2. CSP and guarded commands
CSP: Tony Hoare described CSP in 1978, part of which is based on guarded commands.

Dijkstra first described guarded commands as the basis of a nondeterministic language in 1975.

3. Assignment
Assignment:
v:= e


4. Conditional
Nondeterministic conditional: pick any guard that is true and execute the associated statement-list (abort if no guard is true).
if <guard>1 -> <statement-list>1 ; <guard>2 -> <statement-list>2 ; ... <guard>n -> <statement-list>n ; fi


5. Repetition
Nondeterministic loop: pick any guard that is true and execute the associated statement-list (skip when no guard is true).
do <guard>1 -> <statement-list>1 ; <guard>2 -> <statement-list>2 ; ... <guard>n -> <statement-list>n ; od


6. CSP
Communicating sequential processes, or CSP, notation:

7. Parallel assignment
Parallel assignment:
v1, v2, ..., vn := e1, e2, ..., en


8. Messages
Send message to process pi:
pi ! <message>

Receive message from process pj:
pj ? <message>


9. Exercises
Exercises: Write CSP programs to do the following.

10. End of page

by RS  admin@robinsnyder.com : 1024 x 640