[plt-scheme] PLT Webserver - (manager-instance-unlock! manager) instance-id

From: Jay McCarthy (jay.mccarthy at gmail.com)
Date: Sat Jul 7 22:01:01 EDT 2007

On 7/5/07, Hans Oesterholt-Dijkema <hdnews at gawab.com> wrote:
> Does anyone know under what circumstances an instance-id of a servlet
> gets unlocked, so that the manager can cleanup the instance?

Servlet instances are no longer locked or unlocked. That was a hack
that isn't used anymore.

> I'm currently cleaning up locked instances with 0 continuations,
> but that has a pitfall when a servlet has created a thread, because
> the thread will be killed.
> Is there any way around that, or should I just avoid starting threads
> in servlets?

If a thread is started by an instance, then its custodian is the
custodian of the instance, so when that is shutdown, the thread is
shut down. You could start the thread with the servlet custodian (the
custodian at module require time) --- or, use a new
make-servlet-namespace to get a module to define a custodian outside
the purview of the server.


Jay McCarthy <jay.mccarthy at gmail.com>

Posted on the users mailing list.