www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - Communicating Sequential Processes + D = DCSP

reply Mikola Lysenko <mclysenk mtu.edu> writes:
DCSP is a lightweight concurrency library that I wrote last summer. 
While most threading libraries seek to avoid concurrency or eliminate it 
entirely, DCSP takes a slightly different approach.  The idea grew from 
the work I did on StackThreads and is inspired by C.A.R. Hoare's 
Communicating Sequential Processes and Robin Milner's Pi-Calculus.  In 
DCSP, concurrency is the essential feature of program design.  This is 
not as absurd as it initially sounds, since many programs are innately 
concurrent.

A DCSP program is composed of a network of communicating processes, each 
connected by synchronous point-to-point channels.  This idea is easy to 
visualize like a large digital circuit.

The syntax is closer to Occam, and is far simpler than JCSP. 
Additionally, the performance of DCSP far surpasses JCSP, and unlike 
C++CSP, DCSP is actually multi-threaded.

The current version supports two schedulers, one cooperative scheduler 
based on stack threads, and another threaded scheduler using Phobos' 
threads.  In the future, these may be supplemented with a hybrid 
scheduler using a work-stealing algorithm similar to MIT's CiLK project. 
  Additionally, the basic ideas in this project could be extended to 
network communication.

Anyway, you can check out the library at: http://www.assertfalse.com

JCSP: http://www.cs.kent.ac.uk/projects/ofa/jcsp/
C++CSP: http://www.twistedsquare.com/cppcsp/
Occam: http://www.wotug.org/occam/
Communicating Sequential Processes: http://www.usingcsp.com/cspbook.pdf

-Mik
Jan 28 2007
next sibling parent John Reimer <terminal.node gmail.com> writes:
On Sun, 28 Jan 2007 23:50:24 -0500, Mikola Lysenko wrote:

 DCSP is a lightweight concurrency library that I wrote last summer. 
 While most threading libraries seek to avoid concurrency or eliminate it 
 entirely, DCSP takes a slightly different approach.  The idea grew from 
 the work I did on StackThreads and is inspired by C.A.R. Hoare's 
 Communicating Sequential Processes and Robin Milner's Pi-Calculus.  In 
 DCSP, concurrency is the essential feature of program design.  This is 
 not as absurd as it initially sounds, since many programs are innately 
 concurrent.
 
 A DCSP program is composed of a network of communicating processes, each 
 connected by synchronous point-to-point channels.  This idea is easy to 
 visualize like a large digital circuit.
 
 The syntax is closer to Occam, and is far simpler than JCSP. 
 Additionally, the performance of DCSP far surpasses JCSP, and unlike 
 C++CSP, DCSP is actually multi-threaded.
 
 The current version supports two schedulers, one cooperative scheduler 
 based on stack threads, and another threaded scheduler using Phobos' 
 threads.  In the future, these may be supplemented with a hybrid 
 scheduler using a work-stealing algorithm similar to MIT's CiLK project. 
   Additionally, the basic ideas in this project could be extended to 
 network communication.
 
 Anyway, you can check out the library at: http://www.assertfalse.com
 
 JCSP: http://www.cs.kent.ac.uk/projects/ofa/jcsp/
 C++CSP: http://www.twistedsquare.com/cppcsp/
 Occam: http://www.wotug.org/occam/
 Communicating Sequential Processes: http://www.usingcsp.com/cspbook.pdf
 
 -Mik
Nice work, Mik! Thanks for contributing this. I think there may be some valuable applications for D and CSP. It might be fun to try using it with games/graphic software -- perhaps using the cooperative scheduler initially. It's certainly an opportunity to showcase concurreny theory implementations in D. Thanks much! -JJR
Jan 28 2007
prev sibling next sibling parent reply Bill Baxter <dnewsgroup billbaxter.com> writes:
Mikola Lysenko wrote:
 DCSP is a lightweight concurrency library that I wrote last summer. 
 While most threading libraries seek to avoid concurrency or eliminate it 
 entirely, DCSP takes a slightly different approach.  The idea grew from 
 the work I did on StackThreads and is inspired by C.A.R. Hoare's 
 Communicating Sequential Processes and Robin Milner's Pi-Calculus.  In 
 DCSP, concurrency is the essential feature of program design.  This is 
 not as absurd as it initially sounds, since many programs are innately 
 concurrent.
 
 A DCSP program is composed of a network of communicating processes, each 
 connected by synchronous point-to-point channels.  This idea is easy to 
 visualize like a large digital circuit.
 
 The syntax is closer to Occam, and is far simpler than JCSP. 
 Additionally, the performance of DCSP far surpasses JCSP, and unlike 
 C++CSP, DCSP is actually multi-threaded.
 
 The current version supports two schedulers, one cooperative scheduler 
 based on stack threads, and another threaded scheduler using Phobos' 
 threads.  In the future, these may be supplemented with a hybrid 
 scheduler using a work-stealing algorithm similar to MIT's CiLK project. 
  Additionally, the basic ideas in this project could be extended to 
 network communication.
 
 Anyway, you can check out the library at: http://www.assertfalse.com
 
 JCSP: http://www.cs.kent.ac.uk/projects/ofa/jcsp/
 C++CSP: http://www.twistedsquare.com/cppcsp/
 Occam: http://www.wotug.org/occam/
 Communicating Sequential Processes: http://www.usingcsp.com/cspbook.pdf
 
 -Mik
Excellent. I spent some time programming Inmos Transputers using Occam back in the day. But I have to say the project of yours that I think really deserves more attention is *Professor Automaton's Cruel Legume Device*. http://www.assertfalse.com/puyo/www/ :-) Burned many hours on puyo puyo back in the day too. :-) *DAI DAGEKI!* --bb
Jan 28 2007
parent kris <foo bar.com> writes:
Bill Baxter wrote:
 Mikola Lysenko wrote:
 
 DCSP is a lightweight concurrency library that I wrote last summer. 
 While most threading libraries seek to avoid concurrency or eliminate 
 it entirely, DCSP takes a slightly different approach.  The idea grew 
 from the work I did on StackThreads and is inspired by C.A.R. Hoare's 
 Communicating Sequential Processes and Robin Milner's Pi-Calculus.  In 
 DCSP, concurrency is the essential feature of program design.  This is 
 not as absurd as it initially sounds, since many programs are innately 
 concurrent.

 A DCSP program is composed of a network of communicating processes, 
 each connected by synchronous point-to-point channels.  This idea is 
 easy to visualize like a large digital circuit.

 The syntax is closer to Occam, and is far simpler than JCSP. 
 Additionally, the performance of DCSP far surpasses JCSP, and unlike 
 C++CSP, DCSP is actually multi-threaded.

 The current version supports two schedulers, one cooperative scheduler 
 based on stack threads, and another threaded scheduler using Phobos' 
 threads.  In the future, these may be supplemented with a hybrid 
 scheduler using a work-stealing algorithm similar to MIT's CiLK 
 project.  Additionally, the basic ideas in this project could be 
 extended to network communication.

 Anyway, you can check out the library at: http://www.assertfalse.com

 JCSP: http://www.cs.kent.ac.uk/projects/ofa/jcsp/
 C++CSP: http://www.twistedsquare.com/cppcsp/
 Occam: http://www.wotug.org/occam/
 Communicating Sequential Processes: http://www.usingcsp.com/cspbook.pdf

 -Mik
Excellent. I spent some time programming Inmos Transputers using Occam back in the day.
Sweet! Me too <g> DCSP has been a long time coming, and it's nice to see such a succinct syntax (quite unlike the C++ and Java attempts). Great job, Mik!
 
 But I have to say the project of yours that I think really deserves more 
 attention is *Professor Automaton's Cruel Legume Device*.
      http://www.assertfalse.com/puyo/www/
 :-)
 Burned many hours on puyo puyo back in the day too. :-)  *DAI DAGEKI!*
Too cruel for me -- I was wasting time on the original Mac FlightSim <g>
 
 --bb
Jan 29 2007
prev sibling next sibling parent Witold Baryluk <baryluk smp.if.uj.edu.pl> writes:
Mikola Lysenko Wrote:
 DCSP is a lightweight concurrency library that I wrote last summer. 
Very nice. I was going to write something similar, but your solution with cooperative scheduler is very good. I will use it my projects, and eventually imeplement asynchronous channels (like in Erlang), and process exception linking. One more time: good work.
Jan 29 2007
prev sibling parent "Joel C. Salomon" <JoelCSalomon Gmail.com> writes:
Mikola Lysenko wrote:
 DCSP is a lightweight concurrency library that I wrote last summer. 
 While most threading libraries seek to avoid concurrency or eliminate it 
 entirely, DCSP takes a slightly different approach.  The idea grew from 
 the work I did on StackThreads and is inspired by C.A.R. Hoare's 
 Communicating Sequential Processes and Robin Milner's Pi-Calculus.  In 
 DCSP, concurrency is the essential feature of program design.  This is 
 not as absurd as it initially sounds, since many programs are innately 
 concurrent.
Have you used Plan 9’s threading libraries at all (on Plan 9 or ported to UNIX) or Inferno/Limbo threading? Can you compare the models? --Joel
Jan 30 2007