]> Sergey Matveev's repositories - public-inbox.git/commit
ipc: work queue support via SOCK_SEQPACKET
authorEric Wong <e@80x24.org>
Sun, 10 Jan 2021 12:15:04 +0000 (12:15 +0000)
committerEric Wong <e@80x24.org>
Tue, 12 Jan 2021 03:51:42 +0000 (03:51 +0000)
commit862d18680dccc30ef6cc8044da925ec5085911b2
tree8d89826248c1d917752444bd88344bbffafcdc01
parent9fd84b74b80eb98855d57f438e88ba9285b3d9a6
ipc: work queue support via SOCK_SEQPACKET

This will allow any number of younger sibling processes to
communicate with older siblings directly without relying on a
mediator process.  This is intended to be useful for
distributing search work across multiple workers without caring
which worker hits it (we only care about shard members).

And any request sent with this will be able to hit any worker
without locking on our part.

Unix stream sockets with a listener were also considered;
binding to a file on the FS may confuse users given there's
already a socket path for lei(1).  Linux-only Abstract or
autobind sockets are rejected due to lack of portability.

SOCK_SEQPACKET via socketpair(2) was chosen since it's POSIX
2008 and available on FreeBSD 9+ in addition to Linux, and
doesn't require filesystem access.
lib/PublicInbox/IPC.pm
t/ipc.t