Hi ! Mikkel: are you subscribed to the list ? If yes, i'll stop CC'ing you, if not please do it and notify us ! > In Handler: > - Change a GError to an Exception to catch all exceptions. > - add initialize() : pass > - add stop () : pass > > We just "pass" instead of throwing exceptions since handlers shouldn't > be forced to implement these. initialize() is as discussed earlier to > do > heavy duty work not suitable for a constructor (read: indexing). > stop() > is to do any kind of clean up or what ever the handler wants to do > with > it's remaing seconds of life :-) (again default to "pass" since most > handlers won't need it). I'm in favor of forgetting the stop methods, we won't use them i think, besides they are not triggered on shutdown.. > > In module_list: > > My goal was to stay as far away from synchronization issues as > possible. The hard part was figuring out how to emit signals from a > thread and handle them in the main loop. I did this by adding idle > handlers (gobject.idle_add is supposedly thread safe) with default gtk > event priorities to the loop and let them emit the signals. There are some things i still don't understand, like the threads_leave enter, those seems to disable multi-threading at all ?! > > Well. I'm in a rush... Hope I got everything in the patch ... You'll find my modified patch in this mail (if it gets through). I changed the multiple thread spawning (you had one thread per handler's initialization all started at the same time!). To do that i have a worker thread that reads from a blocking queue and execute the task. I also ported the existing handlers to use initialize where needed. Can you test it and tell me how it works ? Raf
Attachment:
signature.asc
Description: This is a digitally signed message part