Hacker News new | ask | show | jobs
by Terr_ 648 days ago
> Anything vertically separated can be done in parallel.

This assumes no contention on a limited number of bowls or having only one kitchen tool for beating or whisking etc. :P

I point that out not to demand that the metaphor be bulletproof, but because I think it may help explore something about state-handling and the FP/imperative split.

How might this tiramisu-tree model change if we were limited to N bowls and 1 beater and 1 whisk, unable to treat them as statelessly-shareable or endlessly-duplicable?

2 comments

You're describing (safe) locking of resources, best put forward by Dijkstra in 1965 as the Dining Philosophers problem.

I have yet to see a more practical, elegant solution than Haskell's STM for this: https://www.adit.io/posts/2013-05-15-Locks,-Actors,-And-STM-...

Sounds like you need a Kitchen Monad!