[systemd-devel] [RFC 4/6] proxy-discoveryd: Execute the PAC based proxy in a thread

Lennart Poettering lennart at poettering.net
Mon Apr 13 07:29:31 PDT 2015


On Mon, 13.04.15 14:37, Tomasz Bursztyka (tomasz.bursztyka at linux.intel.com) wrote:

> Hi Lennart and Marcel,
> 
> I'll stick to the thread solution for now, moving the dbus handling in the
> main process.
> I forgot to check about this issue.

I think the cancellation issue should not be ignored. Doing this as
thread is not really an option if we cannot cancel this properly after
a timeout.

I don't see why an out-of-process logic would be that hard... It could
be implemented in a pretty minimalistic way: create an
AF_UNIX/SOCK_SEQPACKET socket before forking, leave one end of it in
the daemon, and pass the other end to all the worker processes. Then,
when there's an URL to look up, just write it in one datagram into the
socket from the daemon side, and wait for one reply on it. Make all
worker threads read() from the other side (the same socket in all of
them), and the kernel will then deliver it to an idle worker thread
and all is good.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list