Gamin/FAM is different from libevent. Gamin/FAM provides file
monitoring services
where as 'libevent' provides a general event notification API to
collect events from different
sources.
Libevent interfaces with the event notification framework that the OS
provides. The
the event notification framework we have on Solaris is 'Event Ports' .
David Pacheco has
provided a patch for libevent to make it work with event ports.
Coming back to the file events notification, yes, we are looking at
porting Gamin(Which is based on
FAM) to use the file events notification API.
In addition to that we are looking at implementing a library which
provides a set of interfaces that
will help do the necessary filtering and caching of file events
information. These interfaces will interact
with the file events API. An interface, to collect the list of changes
from a filesystem or
a directory tree, like it was discussed previously on this forum, will
be included. They will return
a handle of some sort.
Just as an idea, the interfaces can be as follows(fen - for file events
notification):
To start watching a file, directory or a directrory tree:-
handle_t fen_watch(int port, char *fname, time, ...)
handle_t fen_watch_dirtree(int port, char *path, time, ...)
Once we get event notification that will be collected by the
'port_get(port, ...)' interface,
the following can be called to collect the list of changes. Filtering
can be done
based on the types of change events requested.
int fen_get_dirtree_changes(handle_t hd, time, ....)
int fen_get_dir_changes(handle_t hd, time, ....)
int fen_get_file_changes(handle_t hd, time, ...)
For example if a directory modification event is received, then
fen_get_dir_changes() can be called to collect, say, the list
of files that where created.
Similarly, fen_get_dirtree_changes() can be called to collect
changes under a directory tree.
To cancel a watch:
int fen_cancel(handle_t hd)
The details need to be worked out. The application can use the same
event port to collect events from different sources. It would wait
for events using the port_get() interface.
-Prakash.
Richard L. Hamilton wrote:
[...]
The interfaces will be based on the event ports
interfaces. If there is
a commonly
used API, like the Linux's 'inotify' we could provide
that using a library.
[...]
>From what I've read, in terms of what they do, there's perhaps room for
two APIs: one like gamin (as a superset of FAM), and one like libevent.
See http://oss.sgi.com/archives/fam/2003-10/msg00014.html
I'm not sure how good coverage those two would provide of existing
open source apps...
This message posted from opensolaris.org
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org