Process-Based Concurrency: Why Beam and OTP Keep Being Right

(variantsystems.io)

23 points | by linkdd 4 hours ago ago

15 comments

  • baud9600 25 minutes ago

    Very interesting. Reading this made me think of occam on the transputer: concurrent lightweight processes, message passing, dedicated memory! I spent some happy years in that world. Perhaps I should look at BEAM and see what work comes along?

  • joshsegall 3 hours ago

    I think the practitioner angle is what makes interesting. Too many BEAM advocacy posts are theoretical.

    I would push back on the "shared state with locks vs isolated state with message passing" framing. Both approaches model concurrency as execution that needs coordination. Switching from locks to mailboxes changes the syntax of failure, not the structure. A mailbox is still a shared mutable queue between sender and receiver, and actors still deadlock through circular messages.

    • stingraycharles 5 minutes ago

      Stateless vs stateful concurrency management is very different, though; I can roll back / replay a mail box, while this isn’t possible with shared locks. It’s a much cleaner architecture in general if you want to scale out, but it has more overhead.

  • rapsey an hour ago

    > Backpressure is built in. If a process receives messages faster than it can handle them, the mailbox grows. This is visible and monitorable. You can inspect any process’s mailbox length, set up alerts, and make architectural decisions about it. Contrast this with thread-based systems where overload manifests as increasing latency, deadlocks, or OOM crashes — symptoms that are harder to diagnose and attribute.

    Sorry but this is wrong. This is no kind of backpressure as any experienced erlang developer will tell you: properly doing backpressure is a massive pain in erlang. By default your system is almost guaranteed to break in random places under pressure that you are surprised by.

    • Twisol an hour ago

      Yes, this is missing the "pressure" part of "backpressure", where the recipient is able to signal to the producer that they should slow down or stop producing messages. Observability is useful, sure, but it's not the same as backpressure.

    • librasteve an hour ago

      Occam (1982 ish) shared most of BEAMs ideas, but strongly enforced synchronous message passing on both channel output and input … so back pressure was just there in all code. The advantage was that most deadlock conditions were placed in the category of “if it can lock, then it will lock” which meant that debugging done at small scale would preemptively resolve issues before scaling up process / processor count.

      • baud9600 21 minutes ago

        Once you were familiar with occam you could see deadlocks in code very quickly. It was a productive way to build scaled concurrent systems. At the time we laughed at the idea of using C for the same task

        • librasteve 10 minutes ago

          I spreadsheeted out how many T424 die per Apple M2 (TSMC 3nm process) - that's 400,000 CPUs (about a 600x600 grid) at say 1GIPs each - so 400 PIPS per M2 die size. Thats for 32 bit integer math - Inmos also had a 16 bit datapath, but these days you would probably up the RAM per CPU (8k, 16k?) and stick with 32-bit datapath, but add 8-,16-bit FP support. Happy to help with any VC pitches!

  • gethly 32 minutes ago

    Go is good enough.

  • socketcluster an hour ago

    The Node.js community had figured this out long before BEAM or even Elixir existed.

    People tried to introduce threads to Node.js but there was push-back for the very reasons mentioned in this article and so we never got threads.

    The JavaScript languages communities watch, nod, and go back to work.

    • pentacent_hq 42 minutes ago

      > The Node.js community had figured this out long before BEAM or even Elixir existed.

      Work on the BEAM started in the 1990s, over ten years before the first release of Node in 2009.

      • masklinn 26 minutes ago

        And BEAM was the reimplementation of the Erlang runtime, the actual model is part of the language semantics which was pretty stable by the late 80s, just with a Prolog runtime way too slow for production use.

    • leoc 44 minutes ago

      You may be thinking of some recent round of publicity for BEAM, but BEAM is a bit older than JavaScript.

    • worthless-trash 19 minutes ago

      Such authority, much incorrect.

    • xtoilette 43 minutes ago

      BEAM predates node js