CSP# is an implementation of Communicating Sequential Processes (CSP) for .NET environments. It is based on an existing, well established Java implementation, JCSP. There is paper, currently in development, that describes the process of implementation with the details of the obstacles overcome and the results. The project has delivered a fully functional and robust CSP implementation written in C#. It is the only valid option for .NET developers at present. CSP# is an object oriented CSP library aiding process-oriented programming for the .NET Core Framework. Similar to JCSP, it relies on the system-based threads.
This implementation contains CSP concepts such as Process
, Channel
, Timer
, Guard
, Alternative
, Barrier
, Bucket
and AltingBarrier
. The networking package is based on an updated version of original JCSP networking package. Unfortunately, unlike JCSP, CSP# lacks any GUI packages and cannot be used with any user Interface directly because this capability not being present in .NET Core.
The library was evaluated with multiple examples based on previous work, the JCSP documentation and with additional custom
tests created for the purpose of this project. CSP# is the biggest, most feature-rich and only fully operational CSP based library for
.NET. Apart from JCSP this is the only library containing Bucket
and AltingBarrier
concepts.
The tests and examples mentioned in the previous paragraph can be found on the author's GitHub. These projects are called CSPsharp-UCaPE and CSPsharp-docs.
The library can be added directly to your project. If you do not wish to see the code, you can open the solution and publish all the parts of the library. Then import these DLLs to your project.
The library is also available on NuGet. You need to obtain all parts separately. cspsharp-lang
, cspsharp-net2
, cspsharp-plug-n-play
. cspsharp-utils
is included in cspsharp-lang
. You can use the Package Manager.
Not certain where to start and how does that work? The best place to start would be to read through the free books Using Concurrency and Parallelism Effectively. These books and the JCSP used in the examples were the base for the library conversion achieved in this project. The discussed examples, language and the operation can be identically applied to the CSP#.
It could be a good idea to look at the CSPforJava on GitHub and check the Documentation examples provided there. Similarities between Java and C# should ease the understanding of the content. Also, some of these examples were also translated to CSP# and can be found on GitHub.
There is a paper (currently in development) describing the conversion proces, that also explain some mechanics. It's also worthwile to read original paper by Tony Hoare and papers about other attempts to create CSP.NET from Kevin Chalmers and Alex Lehmberg.
A blog for the initial stage of the project can be found here https://cspdotnet.000webhostapp.com/