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).<div>

<div><br></div><div>In Haskell we&#39;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.<br>

<br>  -Ryan</div><div><br><br><div class="gmail_quote">On Tue, May 22, 2012 at 9:55 AM, Benjamin Ylvisaker <span dir="ltr">&lt;<a href="mailto:benjaminy@fastmail.fm" target="_blank">benjaminy@fastmail.fm</a>&gt;</span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Has anyone ever worked on implementing something like this in Haskell?<br>
<br>
<a href="http://www.cs.hmc.edu/~stone/papers/ocm-unpublished.pdf" target="_blank">http://www.cs.hmc.edu/~stone/papers/ocm-unpublished.pdf</a><br>
<br>
The outline of the idea:<br>
<br>
- Concurrent programming is really hard with the popular frameworks<br>
today.<br>
- For most purposes parallel programming is hard, in some part because<br>
it requires concurrent programming.  Of course there are attempts to do<br>
non-concurrent parallel programming, but I hope it&#39;s not too<br>
controversial to say that such frameworks are still on the fringe.<br>
- Cooperative concurrency is way easier than preemptive concurrency<br>
because between invocations of pause/yield/wait, sequential reasoning<br>
works.<br>
- Historically, cooperative concurrency only worked on a single<br>
processors, because running threads in parallel would break the<br>
atomicity of sequential blocks (between invocations of p/y/w).<br>
- Researchers have been poring tons of effort into efficiently running<br>
blocks of code atomically.<br>
- Hey, we can do parallel cooperative multithreading!<br>
<br>
The paper discusses implementations in Lua, C++ and C, but I think<br>
Haskell could be an awesome substrate for such a framework.  Has anyone<br>
thought about this?<br>
<br>
Ben<br>
<br>
_______________________________________________<br>
Haskell-Cafe mailing list<br>
<a href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/haskell-cafe" target="_blank">http://www.haskell.org/mailman/listinfo/haskell-cafe</a><br>
</blockquote></div><br></div></div>