Re: [PATCH/WIP v2 00/14] inotify support
- From
Thomas Rast <tr@thomasrast.ch>
- Date
- Jan 20, 2014, 21:51 UTC
- Message-ID
- <87iotecof7.fsf@thomasrast.ch>
- In-Reply-To
- <CACsJy8AbsC8m5ju8pj2r3GzyUEiYSp5Kye=d+OhhTDaOhte8hg@mail.gmail.com>
Duy Nguyen <pclouds@gmail.com> writes:
Show 9 quoted lines
>> I think a clever way to handle this would be to add a new command: >> >> Wait:: >> This command serves synchronization. Git creates a file of its >> choice in $GIT_DIR/watch (say, `.git/watch/wait.<random>`). Then it >> sends "wait <path>". The watcher MUST block until it has processed >> all change notifications up to and including <path>. > > So wait.<random> inotify event functions as a barrier. Nice.
I forgot to specify a return for "wait". Not sure you need one, though correctly handling the timeout (that you apply for all select()) may be somewhat tricky without it.
>> Ok, that's probably a confused sum of rambles. Let me know if you can >> make any sense of it. > > Thank you for your input. Now I'm back to the white board (or paper).
Don't go too far ;-)
Thanks a lot for doing this! It's good that you picked it up, and I think your design strikes a good balance in the complexity of the protocol and the daemon's state.
-- Thomas Rast tr@thomasrast.ch