David Cournapeau wrote: >>> >>> >> If nothing is known about memory allocation of the external library, >> then I don't see how it can be safely interrupted using any mechanism. >> >> > If the library does nothing w.r.t signals, then you just have to clean > all the things related to the library once > you caught a signal. This is no different than cleaning your own code. >
Right, as long as you know what to do you are O.K. I was just thinking about a hypothetical situation where the library allocated some temporary memory that it was going to free at the end of the subroutine but then an interrupt jumped out back to your code before it could finish. In a case like this, you would have to use the "check if interrupt has occurred" approach before and after the library call. But, then that library call is not interruptable. I could also see wanting to be able to interrupt a library calculation when you know it isn't allocating memory. So, I like having both possibilities available. So far we haven't actually put anything in the numpy code itself. I'm leaning to putting PyOS_InterruptOccurred-style checks in a few places at some point down the road. -Travis ------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ Numpy-discussion mailing list Numpy-discussion@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/numpy-discussion