2 ms·
STM in Haskell is quite nice. I only had a quick play with it, and it was quite a while ago, but the idea IIRC is that you can put messages on Queues called Cha
by quickthrower2 8y ago
STM in Haskell is quite nice. I only had a quick play with it, and it was quite a while ago, but the idea IIRC is that you can put messages on Queues called Channels and then consume them.
Here is something I knocked up: https://github.com/mcapodici/haskelllearn/tree/master/stockexchangeprototype https://github.com/mcapodici/haskelllearn/tree/master/stocke...
- kasey_junk 8y agoFairly certain STM is implemented with locks, at least weiteSets are.
- quickthrower2 8y agoAh perhaps. It certainly nicer than an explicit locks in "business" code
- kasey_junk 8y agoSure. But in this context I assume the question is about a specific class of algorithm: https://en.m.wikipedia.org/wiki/Non-blocking_algorithm https://en.m.wikipedia.org/wiki/Non-blocking_algorithm Lots of abstractions ‘hide’ the locks from you. Very few are lock free.