Code example edit
# From https://securitykiss.com/resources/tutorials/csp_project/csp.html
proc sender1 {ch} {
foreach i {1 2 3 4} {
puts "Sending $i"
$ch <- $i
}
puts "Closing channel"
$ch close
}
proc receiver1 {ch} {
while 1 {
puts "Receiving [<- $ch]"
}
}
# create unbuffered (rendez-vous) channel
channel ch
go sender1 $ch
go receiver1 $ch
vwait forever
See Also edit
- The CSP page catalogues a number of CSP/actor-model related packages.
- tcl-hacks includes a re-implementation of this package using TclOO
Discussion edit