Libcsp: a fast C concurrency library influenced by the CSP model
1–10 of 26 posts
Re: Libcsp: a fast C concurrency library influenced by the CSP model
#2Re: Libcsp: a fast C concurrency library influenced by the CSP model
#3Re: Libcsp: a fast C concurrency library influenced by the CSP model
#4Re: Libcsp: a fast C concurrency library influenced by the CSP model
#5There is also http://libdill.org/ which has a different, better in my view, model and I have actually used in production.
Re: Libcsp: a fast C concurrency library influenced by the CSP model
#6> communicating sequential processes (CSP) is a formal language for describing patterns of interaction in concurrent systems
The Libcsp project says it’s influenced by CSP. Does libcsp stick to this formal language?
1 - https://en.wikipedia.org/wiki/Communicating_sequential_proce...
Re: Libcsp: a fast C concurrency library influenced by the CSP model
#7There is also http://libdill.org/ which has a different, better in my view, model and I have actually used in production.
I dont think libdill supports multiple CPUs, which is really hard to get right
It's more correct to say that it doesn't come with that support out of the box, but it certainly does allow for it and nudges you towards a specific direction (no shared mutable state).
Re: Libcsp: a fast C concurrency library influenced by the CSP model
#8Re: Libcsp: a fast C concurrency library influenced by the CSP model
#9The side by side with Go is actually impressive: https://libcsp.com/
Re: Libcsp: a fast C concurrency library influenced by the CSP model
#10The side by side with Go is actually impressive: https://libcsp.com/
I suspect it stops being so nice when you want to do something equivalent to go's `select` statement. Though that's purely speculation, and if I'm wrong it should definitely go in the examples!
1. As you suggest, there's no equivalent to the `select` mechanism. To perform the equivalent, you must busy loop and call `csp_chan_try_pop`.
2. It appears you cannot nest coroutines.
3. The mutex implementation does not provide an RWMutex.
4. `csp_yield` seems somewhat necessary for practical applications.
Normally I would not use another language as a basis for comparison to a C library, but that's precisely what the author of Libcsp appears to be aiming for.
All that said, there's a really slick implementation of a lock free RB queue backing this library, and It's a neat project. I think it would stand on its own better than as a "go style in C" library.