Ruby implementation of Communicating Sequential Processes
Ruby
Switch branches/tags
Nothing to show
Latest commit f17c910 Feb 2, 2010 @dasch dasch Add advanced choice
Permalink
Failed to load latest commit information.
benchmarks
examples Simplify the simple example Jan 31, 2010
lib
test
.gitignore
README.md Simplify example code Jan 31, 2010
Rakefile
VERSION Version bump to 0.0.1 Jan 31, 2010

README.md

Concurrent Sequential Processes

This library provides a concurrency framework based on the work of Tony Hoare in his book "Communicating Sequential Processes".

Usage

With CSP, your problem is modelled by processes that run concurrently, but are sequential internally. These processes communicate over channels, which provide a simple messaging API.

# Prints "Hello, World!" to stdout.
chan = CSP::Channel.new
CSP::Process.start { puts(chan.read) }
CSP::Process.start { chan << "Hello, World!" }

Note that the process is blocked when trying to read on the channel, and only resumes execution when it is able to read a value.