Behavior-Oriented Concurrency for Python

(microsoft.github.io)

47 points | by mpweiher 9 hours ago ago

5 comments

  • chombier an hour ago ago

    I was a bit curious to learn what the differences are between this and the actor model, and I found this lobste.rs discussion to be helpful: https://lobste.rs/s/gsjskz/behavior_oriented_concurrency_for

    > In BoC, the equivalent of a message is received by multiple actors and operates with exclusive access to the message and all of the receivers.

    (emphasis mine)

    IIUC with actors, messages are processed by exactly one actor so it can be difficult to express transactions (e.g. transferring funds from A to B cannot be done atomically). Erlang somewhat fixes this with "selective receive" which re-introduces the possibility of deadlocks. BoC fixes both issues.

  • krystalgamer 3 hours ago ago

    the example is atrocious, seems like erlang actor model but for python.

    • pmontra an hour ago ago

      It is Erlang inspired. They write

      > One of the enabling technologies for BOC is Erlang-style send and selective receive.

      And the example with match, receive, case is a few lines below. It's more or less what one would write in Erlang.

  • hanselot 3 hours ago ago

    Is it just me or is the example they use for the locking extremely badly implemented?

    Why would one ever result at that methodology?

    • rirze an hour ago ago

      It's researchers trying to contrive an example for why their research effort deserves a budget every year.

      Of course their example will be detached from reality. But it doesn't matter.