Project

csp

0.0
No commit activity in last 3 years
No release in over 3 years
Massive concurrency with message-passing and stuff.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

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.