<div dir="ltr"><div><div><div>Hi Tom.<br><br></div>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.<br><br>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.<br><br>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.<br><br></div>Hope this clarifies use-case a bit.<br><br></div>Thanks.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Feb 9, 2015 at 1:19 PM, Tom Ellis <span dir="ltr"><<a href="mailto:tom-lists-haskell-cafe-2013@jaguarpaw.co.uk" target="_blank">tom-lists-haskell-cafe-2013@jaguarpaw.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">From associate of mine: "I am quite curious if anyone actually uses Haskell<br>
(esp STM) successfully in business."<br>
<br>
Of course I can anwser the general question about usage of Haskell in<br>
business, but I don't know much about STM specifically.  Can anyone provide<br>
me with any references to where STM has been used in production in a<br>
business setting?<br>
<br>
Thanks,<br>
<br>
Tom<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>