Re: [PATCH] Explain how to read a single inotify event.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hello Eric,

On Wed, Apr 25, 2012 at 6:11 AM, Eric Wong <normalperson@xxxxxxxx> wrote:
> "Michael Kerrisk (man-pages)" <mtk.manpages@xxxxxxxxx> wrote:
>> My question is, why do you want to propose this technique for reading
>> a *single* event.?
>
> It could be useful in multithreaded/multiprocess apps that rely on an
> inotify descriptor to distribute work to a thread pool.  accept() and
> mq_receive() users do it all the time.

In that case, I'd have thought it more efficient to have a manger
thread read blocks of events and hand them out to members of the pool.
This would be more efficient than performing multiple read() calls.
The difference for accept() and mq_receive() is that they retrieve
single "events" *by definition*.

Cheers,

Michael


-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Author of "The Linux Programming Interface"; http://man7.org/tlpi/
--
To unsubscribe from this list: send the line "unsubscribe linux-man" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Netdev]     [Linux Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Memory]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Photo]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]     [Linux Resources]

Add to Google Powered by Linux