Re: [C++-sig] Cplusplus-sig Digest, Vol 17, Issue 4

2010-02-03 Thread Pascal Briet
Thanks to Renato, the solution was just... PyEval_InitThreads ! Thanks for your help ! Matthew, you're right, there is just one thread running at a time in Python. But, if my understanding of the Python API is correct, more than one thread can be registered to the Python Interpreter (PyThreadSt

[C++-sig] how do i interrupt a C++ extension?

2010-02-03 Thread Amos Anderson
Hello -- I've got a python script with C++ extensions. Some of my extensions take a long time to complete, and I don't want to wait for them to finish when I'm debugging stuff. However, when I do Ctrl-C in my terminal, it's completely ignored. So it looks like python is trapping the signal, but ap

Re: [C++-sig] how do i interrupt a C++ extension?

2010-02-03 Thread Matthew Scouten (TT)
There is no solution. This is a problem inherent in the way python handles the GIL, c extensions, and Signals. Details here: http://www.dabeaz.com/python/GIL.pdf see slide 22 -Original Message- From: cplusplus-sig-bounces+matthew.scouten=tradingtechnologies@python.org [mailto:cplusplu

Re: [C++-sig] how do i interrupt a C++ extension?

2010-02-03 Thread Ralf W. Grosse-Kunstleve
It would be a nice feature to have, but in 8+ years working with Boost.Python I never truly needed it. I figure if your extension runs a long time it must have some layers of loops. If you can modify the extension code, I'd reorganize it to move the outer loop into Python. If the extension is a

Re: [C++-sig] how do i interrupt a C++ extension?

2010-02-03 Thread Gustavo Carneiro
On Wed, Feb 3, 2010 at 9:42 PM, Ralf W. Grosse-Kunstleve wrote: > It would be a nice feature to have, but in 8+ years working with > Boost.Python I never truly needed it. > > I figure if your extension runs a long time it must have some layers of > loops. If you can modify the > extension code, I'