C-extension not threadable?

Marcus Stojek stojek at part-gmbh.de
Tue Apr 16 15:26:09 EDT 2002


Hi,

I am using a C-extension in my code that works just fine. Now I have
added threading to keep the UI alive, and a callback function to
notify the UI when the C-function is finished. The thread is started
like this:


T=threading.Thread(group=None,target=ExtModule.CFunction,name=None,
                           args=(a,b,c,self.callback))
        T.start()

#-----------
    def callback(self,dummy):
        wxPostEvent(self,ResultEvent(1,'ready  %s'%(time.clock())))
        return 1


The C-extension does what it is supposed to do, the callback function
works, but the C-function does not start as a parallel thread but is
freezing my UI. Anything basic I miss here ?

Thanks
Marcus



More information about the Python-list mailing list