[HN Gopher] The Deadlock Empire
___________________________________________________________________
The Deadlock Empire
Author : jasonpeacock
Score : 76 points
Date : 2021-12-03 15:48 UTC (7 hours ago)
(HTM) web link (deadlockempire.github.io)
(TXT) w3m dump (deadlockempire.github.io)
| philzook wrote:
| Very cool! I found a TLA+ implementation of the problems
| https://github.com/cobusve/TLAPLUS_DeadlockEmpire that I've been
| meaning to look at more carefully for a while.
| grantjpowell wrote:
| I've worked in Erlang/Elixir for the past few years and I haven't
| had the opportunity to work "in anger"[0] with languages with
| traditional threads/mutexes/sempahores. This game was a blast and
| made me appreciate the Erlang's approach to concurrency. The best
| beginner resouce I've read on Erlang's concurrency model is here
| https://learnyousomeerlang.com/the-hitchhikers-guide-to-conc...
|
| [0] https://erlang-in-anger.com/
| inetknght wrote:
| Nice work!
|
| I wish this had at least one more problem that it could
| highlight: synchronization using sleep() without atomics. A call
| to sleep() isn't guaranteed to flush cache and so the classic
| problem is that you could have two threads waiting on a bool and
| neither of them seeing updates from the other thread.
| karmakaze wrote:
| Really like the gamification, reverse presentation/adversarial
| mode of thinking.
|
| I now generally avoid concurrency mechanisms that don't compose
| but this could have been useful for learning and communicating
| issues that aren't otherwise easy to illustrate to someone who
| doesn't already 'get it'.
| prvak wrote:
| I'm one of authors (Michael Pokorny), nice to see someone posting
| this again :)
| hyperpape wrote:
| Thank you for this, the game did a lot for my understanding of
| concurrency.
| thghtihadanacct wrote:
| Cool logic and a nice layout.
| 2sk21 wrote:
| I loved these puzzles. I was reminded of the famous book by Tony
| Hoare "Communicating Sequential Processes". In that book, he
| describes the trace of a parallel program as all possible
| interleaving of the traces of the individual programs
| gfody wrote:
| the evil scheduler would be useful for catching deadlock bugs
| early
| nyanpasu64 wrote:
| https://github.com/tokio-rs/loom perhaps? It also models weak
| memory reordering, but takes some work to integrate into
| existing apps.
|
| For triggering race conditions in compiled binaries, you could
| try https://robert.ocallahan.org/2016/02/introducing-rr-chaos-
| mo....
| Nzen wrote:
| I don't doubt someone has built something like that for
| testing, though perhaps not as a library. I'm reminded of a
| networking service that does the same at a higher level, given
| its easy to remember name :
| https://github.com/tylertreat/comcast
___________________________________________________________________
(page generated 2021-12-03 23:01 UTC)