[Haskell-cafe] Parallel cooperative multithreading?

Benjamin Ylvisaker benjaminy at fastmail.fm
Tue May 22 15:55:41 CEST 2012


Has anyone ever worked on implementing something like this in Haskell?

http://www.cs.hmc.edu/~stone/papers/ocm-unpublished.pdf

The outline of the idea:

- Concurrent programming is really hard with the popular frameworks
today.
- For most purposes parallel programming is hard, in some part because
it requires concurrent programming.  Of course there are attempts to do
non-concurrent parallel programming, but I hope it's not too
controversial to say that such frameworks are still on the fringe.
- Cooperative concurrency is way easier than preemptive concurrency
because between invocations of pause/yield/wait, sequential reasoning
works.
- Historically, cooperative concurrency only worked on a single
processors, because running threads in parallel would break the
atomicity of sequential blocks (between invocations of p/y/w).
- Researchers have been poring tons of effort into efficiently running
blocks of code atomically.
- Hey, we can do parallel cooperative multithreading!

The paper discusses implementations in Lua, C++ and C, but I think
Haskell could be an awesome substrate for such a framework.  Has anyone
thought about this?

Ben



More information about the Haskell-Cafe mailing list