On Mon, Dec 26, 2016 at 4:52 PM, Christian Testa <[email protected]> wrote:
> Thank you both, Jeroen and William. You have been very helpful :)
>
> I have noticed something strange, which leads me to think that the fork
> decorator is a little more reliable than the alarm solution.

If you can use fork, it will be vastly more robust, due to how it
works.   Under the hood it makes an exact copy of your running
process, does the work in the copy process, then gets the output (as a
string via pickle), and kills that subprocess.  There is (basically)
no possibility of memory leaks, and even segfaults or other horrible
behavior will not kill your parent process.   The drawback is that it
can take slightly longer to run, only output that is relatively small
and pickleable can be returned, and pexpect interfaces lose their
state.

William

> When I use E.rank(only_use_mwrank=false), the alarm does not seem to work.
> This is some sample code where the alarm doesn't seem to work:
>
> E = EllipticCurve([ 1329, 1329, 0, -1, 1 ])
> alarm(5)
> E.rank(only_use_mwrank=false)
> cancel_alarm()
>
> My problem is solved, because I can just use E.analytic_rank() or the fork
> solution, but I thought it was strange and if anybody was looking at this
> post in the future that it might be worth commenting on it for them.
>
>
> On Monday, December 26, 2016 at 3:23:32 PM UTC-6, Jeroen Demeyer wrote:
>>
>> On 2016-12-25 20:05, Christian Testa wrote:
>> > Does anybody have any suggestions that might work for me?
>>
>> try:
>>      alarm(100)
>>      r = E.rank()
>>      cancel_alarm()
>> except AlarmInterrupt:
>>      pass
>
> --
> You received this message because you are subscribed to the Google Groups
> "sage-nt" 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 https://groups.google.com/group/sage-nt.
> For more options, visit https://groups.google.com/d/optout.



-- 
William (http://wstein.org)

-- 
You received this message because you are subscribed to the Google Groups 
"sage-nt" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send an email to [email protected].
Visit this group at https://groups.google.com/group/sage-nt.
For more options, visit https://groups.google.com/d/optout.

Reply via email to