[Haskell-cafe] Use of STM in business?

Konstantine Rybnikov k-bx at k-bx.com
Mon Feb 9 11:46:27 UTC 2015


Hi Tom.

Pretty much anywhere in your program where you have a state, shared by
multiple threads, and which's consistency gets more complex than the one
that's operated by few atomic operations, you might get benefit from using
STM.

For example, I have a web app that needs to operate fast (e.g. from
memory), that's why it has few HashMaps used as a cache. Those HashMaps
need to be consistent with each other, e.g. you need to modify them both
simultaneously to keep data "synced" between them. STM solves this great,
as each of HashMaps is wrapped by TMVar, so update just uses an STM
transaction to update both of them.

While reads often need to read only one of these HashMaps, that's why
putting all of them under single MVar would be a worse idea.

Hope this clarifies use-case a bit.

Thanks.

On Mon, Feb 9, 2015 at 1:19 PM, Tom Ellis <
tom-lists-haskell-cafe-2013 at jaguarpaw.co.uk> wrote:

> From associate of mine: "I am quite curious if anyone actually uses Haskell
> (esp STM) successfully in business."
>
> Of course I can anwser the general question about usage of Haskell in
> business, but I don't know much about STM specifically.  Can anyone provide
> me with any references to where STM has been used in production in a
> business setting?
>
> Thanks,
>
> Tom
> _______________________________________________
> 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/20150209/a7d7dd1b/attachment.html>


More information about the Haskell-Cafe mailing list