[Haskell-cafe] Who is working on high performance threadsafe mutable data structures in Haskell?

Johan Tibell johan.tibell at gmail.com
Fri Oct 28 00:13:32 CEST 2011


Hi,

On Thu, Oct 27, 2011 at 8:45 AM, Ryan Newton <rrnewton at gmail.com> wrote:

> Based a quick perusal of Hackage there does not seem to be a lot of work in
> this area.  Of course, for Haskell the importance of this topic may be
> diminished relative to pure data structures, but for doing systems-level
> work like monad par good concurrent data structures are also very important.
>


Gregory Collins and I haven't wanted a fast lock-free hashtable for some
time. There's also a priority queue (inside an IORef) in the I/O manager
that could use a replacement. Note that this priority queue needs to support
access both by priority and key.


> We are about to embark on some work to fix this problem for monad-par &
> Deques, but if there are others working in this vicinity it would be nice to
> team up.
>    We are going to try both pure Haskell approaches using the new
> casMutVar# primop as well as wrapping foreign data structures such as those
> provided by TBB.  There are a whole bunch of issues with the latter -- see
> Appendix A and help me out if you know how to do this.
>

You could try the FFI approach if it's not too much work but I expect it to
perform worse than a native Haskell version. It'd also be bad for the GC,
which doesn't like having lots of small pinned objects as they fragment the
heap. I'd rather look into what primops/compiler optimizations we're lacking
to be able to do this well from within Haskell.

-- Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20111027/a6f0f994/attachment.htm>


More information about the Haskell-Cafe mailing list