4 ms·
I haven't gotten to use it yet, but I think Pony would at least claim to prevent this problem. On https://tutorial.ponylang.io/types/at-a-glance.html https://tu
by mcintyre1994 6y ago
I haven't gotten to use it yet, but I think Pony would at least claim to prevent this problem. On https://tutorial.ponylang.io/types/at-a-glance.html https://tutorial.ponylang.io/types/at-a-glance.html it says:
> All message passing is causal. (Not casual!)
The word 'causal' is hyperlinked to https://courses.cs.vt.edu/~cs5204/fall00/causal.html https://courses.cs.vt.edu/~cs5204/fall00/causal.html which contains:
> The purpose of causal ordering of messages is to insure that the same causal relationship for the "message send" events correspond with "message receive" events. (i.e. All the messages are processed in order that they were created.)
- ivanbakel 6y agoNot at all - in fact, the problem described in the article is a typical pitfall of the causal ordering system. In a simplified version: A -1-> B B -2-> C A ---3------> C The human expectation is that 2 happens "before" 3, because that's how it looks. The reality is that 1 happens before 3, and 1 happens before 2, but 2 and 3 have no causal relation - and the runtime is free to rearrange them in any order. That's why the solution is essentially A -1-> B B -2-> C B -3-> C Because then 2 really happens before 3.
- mratsim 6y agoEveryone dealing with actors, multithreading, distributed systems should read about Vector Clocks: - https://en.wikipedia.org/wiki/Vector_clock https://en.wikipedia.org/wiki/Vector_clock - Detecting Causal Relationships in Distributed Computations:In Search of the Holy Grail, Schwarz et al - http://www.vs.inf.ethz.ch/publ/papers/holygrail.pdf http://www.vs.inf.ethz.ch/publ/papers/holygrail.pdf
- hugey010 6y agoNow that's some CS I wasn't even aware of! Although, I'm confused why those process clocking topics are considered specific to distributed systems and not computation in general.
- grogers 6y agoThe article was explicit about this. The A->C message was initiated from thread A before the A->B message. So causally the B->C message is after the A->C message, because it's after the A->B message (which itself is after the A->C message). But in this case causality was broken. It wouldn't be confusing if the A->B message was sent first, because then the B->C message would be unordered relative to the A->C message. Depending on the processing at B it would be totally normal that one or the other would reach C first.