Re:Scala Actors: Unifying thread-based and event-based progr...
by DanWaterworth on Sunday January 11, 2015 @03:09PM
(#8871091)
Having used STM in Haskell, actors look like a draconian way to handle shared mutable state.
[ Parent
| on HN ]
Re:Scala Actors: Unifying thread-based and event-based progr...
by lomnakkus on Sunday January 11, 2015 @03:48PM
(#8871237)
Exactly!
Unless you're hitting actual trouble with contention (or some such), there's absolutely no reason to be programming as defensively as we must do in distributed systems.
Re:Scala Actors: Unifying thread-based and event-based progr...
by DanWaterworth on Sunday January 11, 2015 @04:26PM
(#8871387)
If you have problems with contention, you can use a library like this [1], that allows you to perform transactions (with the restriction that you must know the variables you may touch ahead of time) without deadlocking or livelocking.
[1] https://hackage.haskell.org/package/blocking-transactions