Forum OpenACS Q&A: Long running procs in aolserver?

Collapse
Posted by Peter Alberer on
Is there any restriction on the time that a scheduled proc is
allowed to take? Or on a page that does calculations after the
connection has ended? For some background calculations i have a
procedure that will probably run for at least 10min. Where is the
best place to start this calculation?
Collapse
Posted by Dan Wickstrom on
Starting it from a scheduled proc is okay, but you might want to consider running it in a detached thread, so that it doesn't block anything else.  IIRC, the scheduler is a single thread, so when you have something running for 10 minutes nothing else will be scheduled during that time.  Using a mutex and some nsv_set vars to ensure that only one detached thread is running at a time is probably a wise thing to do, if the possiblity exists that the scheduled procs might start stacking up due to blocking on external resources.