views:

38

answers:

1

Hi all,
I have a wxPython application that uses pyinotify (via ThreadedNotifier) to check when a certain file gets modified. When this happens, the application stops watching the file and does some stuff. Everything works fine, except that often the call to ThreadedNotifier.stop() takes a noticeable time, about 4 seconds... Other times, it exits immediately.
Anyone else experienced this? Is this expected?

(Xubuntu 9.04)

A: 

Could it be that it is a polling mechanism with a timeout of about 4 seconds? And that the thread is only really stopped when it is entering the run() stage?

That might have something to do with the threading library.

You could test that by using a notifier with a different timeout.

extraneon
Just found a "def check_events(self, timeout=4000)" inside pyinotify.. Thanks for the hint!
Joril
A hint is often all you need :) Glad it helped though.
extraneon