Scaling on multi-processor machine

A

Atul Kshirsagar

Hello,
GIL prevents my C++ application embedding and extending python to scale even
though I spawn multiple C++ threads. I read lot of references on internet
about using multiple processes rather than threads.

In that direction I was searching for some examples/resources/tools which
can help me create multi-process implementation. My application does need to
pass userdefined class objects to python interpreter. So I guess my
implementation is going to need a protocol to marshal, de-marshal python
objects between processes or use shared memory.

Does anyone here know of any examples/tools to implement the multi-processes
approach with the object/data transfer between the processes ?
 
A

Aahz

GIL prevents my C++ application embedding and extending python to scale even
though I spawn multiple C++ threads. I read lot of references on internet
about using multiple processes rather than threads.

You're not getting any scaling, or you're not getting enough scaling?
 
D

Dieter Maurer

GIL prevents my C++ application embedding and extending python to scale even
though I spawn multiple C++ threads. I read lot of references on internet
about using multiple processes rather than threads.

While your C++ threads are not touching Python objects, they
can release the GIL (but must acquire it again before they touch Python
objects, e.g. call into Python).

Thus, you can have your C++ threads work in parallel as long as
they do not touch Python objects.

Dieter
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top