[Haskell-cafe] ANN: unordered-containers - a new, faster hashing-based containers library
johan.tibell at gmail.com
Wed Feb 23 17:08:10 CET 2011
On Wed, Feb 23, 2011 at 3:30 AM, Alberto G. Corona <agocorona at gmail.com> wrote:
> The point is that pure data structures can not be used as shared data in
> multithreaded environments. They must be encapsulated in mutable blocking
> references, such is MVars, and the whole update process blocks any other
> thread . (it is worst when using TVars) So they are not a replacement for
> mutable data structures such is Data.HashTable.
Depends on your use case. With one writer and multiple readers an
IORef containing a persistent data structure works well. Readers do
not block writers and can they execute concurrently.
HashTable is not a concurrent data structure. You need e.g. a lock
free mutable hash table.
More information about the Haskell-Cafe