3 ms·
At a glance, it seems like delivering a message to one of a pool of waiting processes would be difficult to do in a library. If the process reads a large swath
by jws 11y ago
At a glance, it seems like delivering a message to one of a pool of waiting processes would be difficult to do in a library. If the process reads a large swath of data it may get multiple messages and a fragment. If it reads a fraction of a message then another process might steal the next few bytes. You'd either end up with a reader lock and small reads to not read past the first message, or introducing a demuxing process and doubling your work.
In the single process case there is also a potential performance win by not waking processes to deliver a partial message only to have the process block awaiting the rest.