Re: Manipulate GIL to have Python thread work with pthread native ones

2016-06-01 Thread Lawrence D’Oliveiro
On Tuesday, May 31, 2016 at 10:14:31 PM UTC+12, qsh...@alumni.sjtu.edu.cn wrote: > PyGILState_Ensure/PyGILState_Release. Without a running sample, it is a > little bit hard to understand how Python thread and the native pthread > interact. Python threads *are* native threads (at least on Linux).

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-06-01 Thread dieter
qshh...@alumni.sjtu.edu.cn writes: ... Python/C++ integration ... When I learn about a task to integrate Python with C or C++, I first think of "cython". "cython" facilitates those integrations. Especially, it has annotations to control the GIL. I have used "cython" for the implementation of a

Re: Manipulate GIL to have Python thread work with pthread native ones

2016-05-31 Thread Terry Reedy
On 5/31/2016 1:16 AM, qshh...@alumni.sjtu.edu.cn wrote: Hi Python experts, I need to extend Python with C/C++ to interact with an in-house legacy API. I'm implementing a data subscriber with Python, which subscribes to a data publisher (actually a ZeroMQ publisher socket) and will get notified

Manipulate GIL to have Python thread work with pthread native ones

2016-05-31 Thread qshhnkf
Hi Python experts, I need to extend Python with C/C++ to interact with an in-house legacy API. I'm implementing a data subscriber with Python, which subscribes to a data publisher (actually a ZeroMQ publisher socket) and will get notified once any new messages are fed. In my subscriber, the