
On Sun, Apr 20, 2008 at 5:22 PM, Bryan O'Sullivan
Niklas Broberg wrote:
So API suggestions would be most welcome!
Your challenge will lie in finding an API that can be implemented efficiently on all concerned platforms. I don't know what the characteristics of the Windows or OS X notification APIs are, but if you use inotify on Linux, and you immediately issue a read every time select tells you there's something to be read, you'll easily consume 70% of a CPU when the filesystem gets busy.
With a little guile, you can reduce that overhead by two orders of magnitude, to a fraction of a percent. It's not all that easy to do this well, but using inotify naively is so crippling that you must do it. Any higher-level API must account for factors like this.
Factor has a file system notification API that wraps windows, linux and mac ones. It might be worth taking a look at that to see what it does.