4 ms·
Lots of people have the idea that message passing is good. Maybe slow, but easier than directly hammering on shared memory. Synchronous message passing, as in
by JonChesterfield 3y ago
Lots of people have the idea that message passing is good. Maybe slow, but easier than directly hammering on shared memory.
Synchronous message passing, as in wait for the other guy then swap, is a different thing to pushing work into a queue to be dealt with later. Not just a buffer of size one; the current thread actually blocks until the exchange occurs.
It's another step in the direction of decreased throughput for decreased entropy and I think it's an important one. I personally missed the distinction for a good decade or so, seems plausible others have likewise missed it.
- BoiledCabbage 3y agoAnd between CSP and elixir, which promotes synchronous message passing and which promotes the asynchronous/queue approach?
- Jtsummers 3y agoCSP communication blocks until both sides are ready for the communication. You can create a process which acts as a buffer so that an outputting process is able to communicate so long as the buffer has capacity (and if the buffer size is unbounded then it will never be blocked, at least as long as there is sufficient memory).