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:cplusplus-sig-bounces+matthew.scouten=tradingtechnologies....@py
thon.org] On Behalf Of Amos Anderson
Sent: Wednesday, February 03, 2010 2:24 PM
To: Development of Python/C++ integration
Subject: [C++-sig] how do i interrupt a C++ extension?

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 apparently can't do anything with it until the
extension returns control to the python script. I guess ideally,
Ctrl-C would kill the extension and return control to python,
generating an exception, but I'd also be ok if Ctrl-C killed the
python script too.

I've been googling around, but can't figure out how this seemingly
simple (and desired) task is accomplished. Anybody know how to do it?
Right now, the only solution is Ctrl-Z and kill %1 so I guess that
works for now...

thanks!

Amos.
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig
_______________________________________________
Cplusplus-sig mailing list
Cplusplus-sig@python.org
http://mail.python.org/mailman/listinfo/cplusplus-sig

Reply via email to