2 ms·
> The only way to completely avoid race conditions I know of would be formal methods via TLA+ or similar. From my brief looks into TLA+ it'd appear to match act
by chrisseaton 6y ago
> The only way to completely avoid race conditions I know of would be formal methods via TLA+ or similar. From my brief looks into TLA+ it'd appear to match actor implementation models pretty well (messages to actors yield new states).
The fork-join model does allow you to completely avoid race conditions, because tasks are always created in a deterministic order, each can only work with the immutable input they get, and tasks join also in a deterministic order.
(I think when I say fork-join you're thinking processes fork and join - I mean the abstract concept of fork-join. Map-reduce is an example of a fork-join model and is deterministic and race-free by construction with no proof system needed.)
- elcritch 6y agoAh yes, you’re right. Started thinking that we’re talking about different aspect. I’ve been thinking about models as they’re used in end-user systems. Particularly how it’d fit in with Ruby and Rails, or similar. Actors without a good framework like OTP are indeed a pain. The fork-join model is great for parallelism and computation. Problem is that it’s harder to use for general purpose concurrency where your inputs aren’t immutable or fit into the model. Not that I’ve seen fork-join model really used other than map reduce or some MPI constructs.