Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dasch/ruby-csp
Ruby implementation of Communicating Sequential Processes
https://github.com/dasch/ruby-csp
Last synced: about 19 hours ago
JSON representation
Ruby implementation of Communicating Sequential Processes
- Host: GitHub
- URL: https://github.com/dasch/ruby-csp
- Owner: dasch
- Created: 2009-04-05T22:47:13.000Z (over 15 years ago)
- Default Branch: master
- Last Pushed: 2010-02-02T22:09:44.000Z (almost 15 years ago)
- Last Synced: 2024-12-18T03:09:47.727Z (17 days ago)
- Language: Ruby
- Homepage:
- Size: 97.7 KB
- Stars: 13
- Watchers: 3
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Concurrent Sequential Processes
===============================This library provides a concurrency framework based on the work of Tony Hoare
in his book ["Communicating Sequential Processes"](http://www.usingcsp.com/).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.