[Top][All Lists]

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

Re: A little help for GWorkspace

From: Richard Frith-Macdonald
Subject: Re: A little help for GWorkspace
Date: Fri, 12 Jan 2001 19:43:27 +0000

On Friday, January 12, 2001, at 07:12 PM, Simon Frankau wrote:

> My knowledge on the area is somewhat limited, but would it really be 
> more efficient to have a separate daemon process to stat files, with 
> its associated resources, plus the overhead of IPC to do DO, as 
> compared to each process just doing its own stat/poll calls? 
> I suspect the daemon would not be particularly heavyweight, but would 
> the extra effort of developing it actually produce a tangible 
> improvement? 
> As for receiving signals when a file changes, I don't really see the 
> advantage of this for us over putting the checks in part of the main 
> run-loop. 

I agree that having a separate daemon to do the job is not a good idea -

I'm not convinced that there would be a lot of separate processes
wanting to use the service, and even if there were, they probably wouldn't
be interested in many of the same files/directories ... so I don't
believe there is any advantage.

I think a sensible option would be to write a class to do the job, with an
api mediated by notifications.  Then, minor modifications would let you
place that class in a daemon and use distributed notifications.

You could have notifications to 

1. register an interest in a file
2. unregister an interest
3. notify of a change
4. notify that a file is no longer being watched.

The system would watch any files registered with it for a reasonable length
of time, then stop (and send a notification to say it has stopped).

An app interested in a file would send the registration notification, and send
an unregistration notification when it's no longer interested.  It would listen
for change notifications or notifications that the file is no longer being
watched.  If the system stops watching the file, the app would re-register an

If an app dies without unregistering an interest, the system would automatically
stop watching the registered file after a reasonable interval.

reply via email to

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