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: Tue, 21 Oct 2014 23:09:57 +0300

> From: Dima Kogan <address@hidden>
> Cc: address@hidden, address@hidden
> Date: Tue, 21 Oct 2014 12:39:47 -0700
> 
> If I set the delay in the current code to 0.01 seconds, then isn't
> emacs polling its flag 100 times a second?

Yes.

> I recognize that it's not looking at the file system itself, but
> rather at the flag set by inotify, but this is still work that does
> not need to be done.
> 
> 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.  This is how the Emacs input mechanism
works.  And timers, which are used to poll for buffers that need
reverting, are just an additional job Emacs does in the same loop
where it waits for input, including from inotify, to become ready.

So what exactly is the difference between these two alternatives?



reply via email to

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