Callback from c thread with ctypes

2009-03-08 Thread Victor Lin
Hi, I am going to develop a c library binding with ctypes. That c library will call callback from worker threads it created. Here comes the problem : Will the GIL be acquired before it goes into Python function? I got a little try.. DSPPROC = WINFUNCTYPE(None, DWORD, DWORD, c_void_p, DWORD,

Re: Callback from c thread with ctypes

2009-03-08 Thread Diez B. Roggisch
Victor Lin schrieb: Hi, I am going to develop a c library binding with ctypes. That c library will call callback from worker threads it created. Here comes the problem : Will the GIL be acquired before it goes into Python function? I got a little try.. DSPPROC = WINFUNCTYPE(None, DWORD,

Re: Callback from c thread with ctypes

2009-03-08 Thread Christian Heimes
Victor Lin wrote: Hi, I am going to develop a c library binding with ctypes. That c library will call callback from worker threads it created. Here comes the problem : Will the GIL be acquired before it goes into Python function? I got a little try.. DSPPROC = WINFUNCTYPE(None, DWORD,

Re: Callback from c thread with ctypes

2009-03-08 Thread Victor Lin
On 3月8日, 下午9時56分, Diez B. Roggisch de...@nospam.web.de wrote: Victor Lin schrieb: Hi, I am going to develop a c library binding with ctypes. That c library will call callback from worker threads it created. Here comes the problem : Will the GIL be acquired before it goes into Python

Re: Callback from c thread with ctypes

2009-03-08 Thread Victor Lin
On 3月8日, 下午10時20分, Christian Heimes li...@cheimes.de wrote: Victor Lin wrote: Hi, I am going to develop a c library binding with ctypes. That c library will call callback from worker threads it created. Here comes the problem : Will the GIL be acquired before it goes into Python

Re: Callback from c thread with ctypes

2009-03-08 Thread Christian Heimes
Victor Lin wrote I know I have to call PyEval_InitThreads if my module create threads that will contact python stuff, for example, call a python callback function from threads. But however, it is ctypes. I have no idea should I do that for the imported dll? If it is, how? You have to

Re: Callback from c thread with ctypes

2009-03-08 Thread Lie Ryan
Victor Lin wrote: On 3月8日, 下午9時56分, Diez B. Roggisch de...@nospam.web.de wrote: Victor Lin schrieb: Hi, I am going to develop a c library binding with ctypes. That c library will call callback from worker threads it created. Here comes the problem : Will the GIL be acquired before it goes