emacs-devel
[Top][All Lists]
Advanced

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

Re: Clarification about auto-revert-mode and inotify


From: Eli Zaretskii
Subject: Re: Clarification about auto-revert-mode and inotify
Date: Wed, 22 Oct 2014 05:42:18 +0300

> From: Dima Kogan <address@hidden>
> Cc: address@hidden, address@hidden
> Date: Tue, 21 Oct 2014 13:29:03 -0700
> 
> 
> Eli Zaretskii <address@hidden> writes:
> 
> >> If we have inotify telling us when files are updated, then we don't NEED
> >> to poll anything. This is in fact the whole point of inotify.
> >
> > What do you think happens when inotify sends its notification?  The
> > notification will not be known to Emacs until Emacs reads from the
> > file descriptor allocated for inotify's notifications.  And how does
> > Emacs know it should read from that descriptor?  It polls it, together
> > with the other descriptors.
> 
> I'm using Linux. I just did an strace, and it does not poll anything.
> The main loop uses select() to look at a number of file descriptors, the
> inotify one being just one of them. If there's nothing to do, emacs just
> sits there in the select and does no work. This is as it should be.

Did you look at the code in Emacs that calls 'select'?  If not, please
do: that's where the important details are.

> Are you saying there's no cost to using the current code with a very low
> timeout?

Did you try it?  If not, please do, and measure the CPU load.

> If so, why is the default 5 seconds and not 0.01 seconds?

Because there's no real reason to revert buffers more frequently than
that.  But if you want, you can.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]