Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #109287 > unrolled thread

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

Started byTerry Reedy <tjreedy@udel.edu>
First post2016-05-31 12:31 -0400
Last post2016-05-31 12:31 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Manipulate GIL to have Python thread work with pthread native ones Terry Reedy <tjreedy@udel.edu> - 2016-05-31 12:31 -0400

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

FromTerry Reedy <tjreedy@udel.edu>
Date2016-05-31 12:31 -0400
SubjectRe: Manipulate GIL to have Python thread work with pthread native ones
Message-ID<mailman.55.1464712287.1839.python-list@python.org>
On 5/31/2016 1:16 AM, qshhnkf@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 once any new messages are fed. In my
> subscriber, the messages are dumped to a data processor after
> received. The subscriber will also get notified by the processor when
> done. Since the data processor is written in C++, I have to extend
> the Python code with a simple C++ module.

A couple of options you may not have considered.  A. Run the C++ module 
in a subprocess.  Pass data either in pipes or files.  B. Compile the 
C++ module to a shared library and access via ctype module.

-- 
Terry Jan Reedy

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web