#13311: alarm() doesn't work for Cython code
------------------------------------------+---------------------------------
Reporter: alexc | Owner: jdemeyer
Type: defect | Status: new
Priority: major | Milestone: sage-5.10
Component: c_lib | Resolution:
Keywords: alarm signal interrupt | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
------------------------------------------+---------------------------------
Comment (by leif):
Replying to [comment:4 jdemeyer]:
> The problem is that the `SIGALRM` handling is completely independent of
the usual signal handling, hence it doesn't work. [...]
>
> As an ugly work-around, try using `signal_after_delay()` from
`sage.tests.interrupt`, which generates an ''actual'' interrupt.
A "cleaner" work-around is to use the `@fork` decorator, such that the
computation (implemented in Cython or e.g. C/C++) runs in a subprocess,
while `alarm()` is used in the main (Python) process; cf.
[http://ask.sagemath.org/question/2567/kill-the-thread-in-a-long-
computation this solution on ask.sagemath].
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13311#comment:6>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.