Coder Social home page Coder Social logo

rubycsp's Introduction

Ruby CSP

Communicating Sequential Processes library for Ruby.

Introduction

CSP is a formal language for defining concurrent systems that can be verified mathematically, making it possible to prove the correctness of your concurrent system, ie. that there are no deadlocks, race conditions etc. This library is an implementation of CSP in Ruby 1.9 that introduces a new and better way of developing concurrent programs in Ruby, something that can otherwise be very hard.

The library has been influenced by other CSP implementations including PyCSP (for Python), JCSP (for Java), C++ CSP and Occam, with some other concepts introduced to make it more Ruby-ish wherever possible. You can check out the syntax and behaviour of the library by looking at the files in the examples/ and test/ directories. Later on, a more formal tutorial and some API-docs might be created.

Please note that this library only works with Ruby 1.9, and has only been tested on Linux.

Features

Currently implemented featues include:

  • Processes.
  • Process maps for running processes in parallel.
  • Process labelling for easy reusing of processes.
  • Channels. Can be shared and buffered.
  • Poisoning of channels.
  • Read/write restriction using channel ends.
  • Some simplifying functions for doing common stuff easily.
  • Alternation with input, output, timeout and skip guards.
  • Test and example suite.

Planned features:

  • OS processes. Distribute CSP processes (fibers) on a number of Ruby processes, making it possible to take advantage of multiple CPU cores.
  • Transparent network support. Channels are shared on a TCP socket so that any process can run anywhere on the network.
  • Native processes. Creating an easy way to implement your processes in C/++ or Fortran, possibly using the RubyInline gem.
  • Visualization and inspection. Automatic graph creation for inspecting your CSP network.
  • Logging. Something like CSP traces could be implemented for generic logging and inspection of the state of a system.
  • Suspending/resuming processes and networks. If it’s actually usable for anything.
  • Mobility. Look into pi-calculus and see if some of the concepts of process and channel mobility could be implemented.
  • API docs
  • Gem

rubycsp's People

Contributors

brinkar avatar

Stargazers

Taotao Wang avatar Angus H. avatar Ryan Stout avatar Dariusz avatar Rubathas Thirumathyam avatar  avatar Daniel Schierbeck avatar Lourens Naudé avatar

Watchers

 avatar  avatar

rubycsp's Issues

Ruby processes for multi-core utilization

Fork Ruby processes and distribute the CSP processes among them when running a Map. Make it possible to manually decide to which Ruby processes the CSP processes go.

Built-in logging

CSP traces is a kind of logging. Look into the possibility of implementing them.

Hooks in alternations

Supply a guard with a block that gets executed when this guard is selected in an alternation.

API docs

Commenting the code and creating rdoc API.

Waiting uses 100% CPU

Some way of waiting process bookkeeping needs to be made in order for the scheduler to sleep and wake up when something happens.

Native processes

The possibility to implement processes in C, C++ and Fortran. Inline if possible.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.