Passing large amounts of data between actors without making copies

What you are talking about here sounds very similar to this slide:

taken from one of the WWDC 2021 videos.

This sad cat slide and the corresponding video fragment / text transcript describes the situation of this data race in detail. Along with the author I do not think this is desired behaviour, and yes, that's what I call "high-level data race".

To reiterate a few points I am making:

  1. If we point out to the data race issues in examples that use mutexes and locks it is only fair if we also do this for actors (otherwise readers might get a false impression that actors are free from those issues).
  2. Contrary to a popular belief it is very easy to get those high-level data races with actors, pretty much as easy as with mutexes and queues. Witness to that are examples upthread or even the above WWDC slide.
  3. As actors eliminate low-level data races completely the extra safety net of getting crashes or runtime traps is absent, those things - even if happen unreliably and occasionally - are "the true friends" that politely remind you about your mistakes every now and then and bring your attention to the problematic places in code / commits, whilst with actors you don't have those friends.
  4. It is very easy to miss such issues during PR reviews in anything but trivial examples.

I am glad we (mostly?) agreed that catching such errors at compile time would be a good thing and the only disagreement is whether this is achievable or not. TBH I don't know the answer here, whether it is achievable or not, if yes then by what means, and at what price (or the damage) to the language. Expert opinion from people with experience in languages like Erlang or Haskell could be very helpful in those regards.

Cheers!

1 Like