On Aug 24, 2006, at 18:38 , Travis Oliphant wrote:

>
> You can already use the approach suggested:
>
> if (PyOS_InterruptOccurred()) goto error
>
> to handle interrupts.  The drawback of this approach is that the loop
> executes more slowly because a check for the interrupt occurs many  
> times
> in the loop which costs time.
>
> The advantage is that it may work with threads (I'm not clear on  
> whether
> or not PyOS_InterruptOccurred can be called without the GIL, though).

It should be; it's pure C code:

int
PyOS_InterruptOccurred(void)
{
         if (!interrupted)
                 return 0;
         interrupted = 0;
         return 1;
}

(where interrupted is a static int).

-- 
|>|\/|<
/------------------------------------------------------------------\
|David M. Cooke              http://arbutus.physics.mcmaster.ca/dmc/
|[EMAIL PROTECTED]


-------------------------------------------------------------------------
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

Reply via email to