[pygtk] Database query in a gobject.idle_add()?

Kim Adil kadil at proactiveindustrial.net
Wed Sep 9 10:44:32 WST 2009


Hello,

I am learning/experimenting with the practicalities of threading. I have 
to periodically (approx 60 seconds) retrieve some records from a 
database table and update some object properties, and I would like to do 
so without seeming to interrupt or hang the GUI while the query is 
executing. Timing of the query is not critical at all, if it varied by 
30%, no one would notice. Would you advise implementing the database 
query using gobject.idle_add() or just create a separate thread 
(gtk.threads_enter(), gtk.threads_leave(),etc)?

Thanks,
Kim


More information about the pygtk mailing list