On 4/23/07, Robert Bradshaw <[EMAIL PROTECTED]> wrote:
> > I'll have to think about it.  It's a somewhat tricky problem,
> > possibly involving
> > threads or improving the cleaner process.
>
> I think it might be handy to have some kind of a timeout parameter on
> the cleanup processes (though I'm not sure how one would communicate
> "inactivity", touch a file whenever you're doing something).

Yes, I like that -- it would be very handy.   Measuring inactivity is
the tricky part.
I like your file idea -- with the notebook, every so often it saves its
state to a file -- it would be very easy to add something so that it also
touches a certain file in a tmp directory.  If that file doesn't get touched
for 10 minutes, say, then the notebook server is killed.  This works very
nicely, since, e.g., if the notebook crashes or gets into some weird
horrible loop, after 10 minutes it gets automatically killed by the cleaner.
(I'm imagining a frustrated deranged user who bangs on SAGE via the
notebook, somehow puts SAGE into a resource hogging infinite loop,
then crashes their poor web browser, and is happy when SAGE automatically
cleans up the mess within 2-3 minutes with no further work on their part.

> Alternatively, put something in the "main" loop (or using timed
> callback functions) in the sage notebook server. An idle notebook--ie
> one that's open but not doing any calculations could poll the server
> at some interval shorter than the timeout interval so that the server
> remains up as long as the webpage does, but not long after.

I considered this but I don't really have access to the current "main" loop;
it's owned by the SimpleHTTPServer right now.  Also, this doesn't work
if the notebook crashes or gets into a weird state -- we want the thing
to stop after 10 minutes (say), no matter what.  Using a separate cleaner
process seems much better from this point of view.   And the result will
likely be very widely useful.

Thanks for your ideas.

William

--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://sage.scipy.org/sage/ and http://modular.math.washington.edu/sage/
-~----------~----~----~----~------~----~------~--~---

Reply via email to