4 ms·
I’ve always wondered if there was some analogous technique for drawing out parallel programming from lock acquisition to atomic variables. I always find them so
by chillacy 8y ago
I’ve always wondered if there was some analogous technique for drawing out parallel programming from lock acquisition to atomic variables. I always find them so much more difficult to reason about in code form due to all the ways different threads can interact, it seems drawing them on 2D might help.
- zwkrt 8y agoyou already can do this in 1d by just writing out the possible sequences of events. Feynman diagrams are used to help enumerate all possible particle interactions, including 'virtual' interactions, but there are no virtual interactions in multithreaded programming.
- TeMPOraL 8y agoAren't they though? Also, I'm sure someone will eventually match this concept with something, probably building an esoteric language for describing parallel programs with Feynman diagrams, just for the kicks.
- chillacy 8y agoYea I know, but it still leaves something to be desired. You can encode a 3D shape as a list of all possible of 2D slices too, but often it'll be easier to visualize as a 3D shape. It's not a perfect metaphor, but I'm looking for new ways to visualize concurrency.
- akvadrako 8y agoThere are virtual interactions in multithreaded programming. Virtual in this sense basically means internal - if two threads have a secret backchannel to send messages and you don't have access to any of their internals, you can model their behavior with "virtual" messages. To be general, it would even be a mixture of all possible implementations. Only those messages detectable from the outside are "real". Besides, if you have threads separated by significant difference, there isn't even a canonical ordering of events due to special relativity.
- evanb 8y agoYou may be interested in Leslie Lamport's "Time, Clocks, and the Ordering of Events in a Distributed System" https://amturing.acm.org/p558-lamport.pdf https://amturing.acm.org/p558-lamport.pdf