[Haskell-cafe] Parallel cooperative multithreading?

Ryan Newton rrnewton at gmail.com
Wed May 23 06:23:25 CEST 2012


Personally, I think cooperative concurrency is making a big comeback.
 Especially in a compiler-supporting form that relies on limited CPS
(continuation-passing-style) transformation.  There are server and web
services applications that motivate it (i.e. in Scala, F# async work flows).

In Haskell we've got ContT for capturing the continuation of one
computation (and yielding to another).  Monad-par is an example of a
framework based on ContT in which tasks cooperatively yield control
whenever their desired input data is not yet available.

  -Ryan


On Tue, May 22, 2012 at 9:55 AM, Benjamin Ylvisaker
<benjaminy at fastmail.fm>wrote:

> 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
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20120523/138deb1f/attachment-0001.htm>


More information about the Haskell-Cafe mailing list