Re: [sage-devel] Signal handling

2013-03-29 Thread Johannes
maybe another (untested) suggestion is, to start a sage instance in background, separated from django and communicate over a network protocol with each other. this has the further advantage, that you can separate the web-server from the sage installation for security of performance reasons. bg, Jo

Re: [sage-devel] Signal handling

2013-03-29 Thread tom d
Ok, cool; as I'm looking around more, it's seeming like getting a good grasp of how the cell server is working and using or adapting it appropriately. Will keep on hacking. On Friday, March 29, 2013 2:29:57 PM UTC+3, Volker Braun wrote: > > This is somewhat scary ;-) You can execute arbitrary m

Re: [sage-devel] Signal handling

2013-03-29 Thread Volker Braun
This is somewhat scary ;-) You can execute arbitrary machine code from within Sage, so you need to have a plan for how to isolate it from the web frontend. Importing it all into one process is a bad idea. On Friday, March 29, 2013 7:23:10 AM UTC, tom d wrote: > > I'm trying to import the sage li

Re: [sage-devel] Signal handling

2013-03-29 Thread tom d
Hm, the issue is that there's really big startup costs for Sage; it looks based on my cursory understanding of subprocess that there's a couple seconds of hang-time for each calculation one wants to execute. This doesn't really scale. I know there's something involving spawning a pile of kern

Re: [sage-devel] Signal handling

2013-03-29 Thread David Roe
You could just use call from the Python subprocess module, which is documented in the Python docs. It depends on exactly what functionality you need from Sage. David On Fri, Mar 29, 2013 at 12:58 AM, tom d wrote: > Ok, the patch maybe works. Sage starts normally after patching, but I'm > gett

Re: [sage-devel] Signal handling

2013-03-29 Thread tom d
Ok, the patch maybe works. Sage starts normally after patching, but I'm getting a segfault from the django process when I try to load a webpage, so not sure what that's about Is there documentation or good examples somewhere on how to use Sage as a subprocess? On Friday, March 29, 2013 10

Re: [sage-devel] Signal handling

2013-03-29 Thread tom d
Cool, I'll give the patch a shot. It looks like some other projects have a variable or option for disabling interrupts for exactly this reason; if a patch works, it might make sense to do signals optionally in Sage. I'm trying to import the sage libraries into some Django code. I'm playing wi

Re: [sage-devel] Signal handling

2013-03-29 Thread Jeroen Demeyer
On 03/28/2013 11:44 PM, tom d wrote: The problem seems to be at: from sage.ext.c_lib import _init_csage, sig_on_count _init_csage() which is explicitly using the signal library and doing signal handling stuff for Sage. Any idea how deep this goes? Some of the online suggestions are about using

[sage-devel] Signal handling

2013-03-28 Thread tom d
Hello! I'm trying to run Django inside of the Sage python and import the sage libraries. (Idea: "Hey, look, a web server that can find derivatives!") The Django install into my Sage install went fine, but I'm getting an error when trying to import the Sage libraries: http://dpaste.com/1038581

[sage-devel] Signal Handling

2008-06-09 Thread [EMAIL PROTECTED]
Hi, I have been revisiting some process control code in Knoboo, and realized how well Sage responds to SIG-INT compared to standard Python. It basically works too good... ;) Can somebody point me to the most relevant pieces of code/ documentation concerning signal handling in Sage so I can learn