[systemd-devel] [RFC 6/8] HACK2: blocking ioctl(CMD_MSG_RECV)

Kay Sievers kay at vrfy.org
Wed Jun 25 03:30:19 PDT 2014


On Wed, Jun 25, 2014 at 11:13 AM, AKASHI Takahiro
<takahiro.akashi at linaro.org> wrote:
> In the current implementation, ioctl(CMD_MSG_RECV) returns immediately if
> no message has been queued, and so a service process has to wait by
> explicitly calling poll() system call. If such a process needs to wait only
> on a single connection, we can eliminate poll() system call by adding a
> synchronous attribute in receiving a message.

Why is this useful in general? The peer can call RECV in a loop until
EAGAIN without ever needing to call poll() as long as data is
available.

When there is no more message to handle, poll() is used to suspend the
process, and only when it is idle anyway.

Busy processes, the use-case we would optimize for, should not see a
real benefit here?

Kay


More information about the systemd-devel mailing list