Questions on the C Thread API

Dave Cole djc at object-craft.com.au
Mon Apr 15 19:51:16 EDT 2002


>>>>> "Phil" == Phil Thompson <phil at river-bank.demon.co.uk> writes:

Phil> This is the bit I don't understand. How can I get the saved
Phil> thread state for the current thread? Do you mean I can use the
Phil> Python API to get it (in which case I get back to Catch 22)? Or
Phil> do you mean I have to write code that determines by other means
Phil> what the current thread is and then get the corresponding Python
Phil> thread state?

I am about to try doing almost exactly the same thing with my Sybase
module.  The way I understand it is that your code is responsible for
associating the Python thread state with the actual thread.

The way I am going to do it is to store the Python thread state inside
one of my structures which I associate with one of the Sybase API
callback parameters.  When Sybase invokes a callback I then locate the
correct threadstate by searching through non-Python structures and
recquire the GIL.

- Dave

-- 
http://www.object-craft.com.au



More information about the Python-list mailing list