tech-kern archive

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

Re: GSoC 2011 project proposal [Add kqueue support to GIO]



On 29.03.2011 17:35, Julio Merino wrote:
> As far as I know, you are right, kqueue won't work to monitor trees.
> My understanding is that, to watch for changes to a particular tree,
> you need to watch all the directories in such tree.

Yep.

> I hadn't thought of the need to watch whole trees being a problem
> though.  I don't think this is a general case in desktop applications,
> and for something like mediatomb, the amount of files to watch should
> be (well, at least in my case ;-) way larger than the amount of
> directories.

Having some kind of "recursive" kqueue could be useful when one wants to
monitor a large set of directories and subdirs, to index their content
each time there is a change under them (see FD.o Xesam work, for example).

The real challenge is rather the way you could report the "change" event
(how do you know which path to take to the modified dir or file then),
and that layouts of filesystems look more like graphs (links...) rather
than trees today.

> Does inotify support this?

IIRC, inotify does, but not at the API level; given a path, it lists
subdirs, and register an event for each one recursively. IMHO, this is
the sanest and safest way, but that can make many, many filedes :)

> An alternative solution to the "monitoring trees" problem is what OS X
> does: http://arstechnica.com/apple/reviews/2007/10/mac-os-x-10-5.ars/7

I did not know that stuff. Definitely a good read, thanks for the link.

-- 
Jean-Yves Migeon
jeanyves.migeon%free.fr@localhost


Home | Main Index | Thread Index | Old Index