On Fri, 8 Nov 2002 09:49:40 -0500, Daniel C. Wickstrom
<[EMAIL PROTECTED]> wrote:

>For instance, a big hurdle in integrating java with aolserver was due to
>the way aolserver initiates startup.  While starting, aolserver blocks
>signals.  Java virtual machines use signals to control garbage
>collection, so for a jvm created in aolserver's main thread, a garbage
>collection cycle will cause aolserver to freeze.  This is because the
>garbage collector thread suspends at the end of its cycle, and it
>doesn't wake up because it can't catch the wakeup signal that is blocked
>by aolserver.  The work-around for this is to spawn a new -jvm- thread
>for creating the jvm and switch back to the main thread once the jvm is
>initialized.  This allows the jvm to be created, but problems still
>persist during sourcing of the tcl libraries. Since the jvm can't be
>attached to in the main thread, I had to build a proxy command interface
>just for the main thread, so that java commands could be dispatched to
>the -jvm- thread and the results returned to the main thread.  This is
>kind of messy, and it gets worse.  Java commands dispatched to the -jvm-
>thread can't access a tcl interpreter, since aolserver blocks new
>interpreter allocation until the main startup thread has completed.
>This makes it impossible to access the db api from java during the
>startup process.  Once aolserver is up and running, the interface to tcl
>and aolserver and tcl is quite clean, and it works well in the context
>of connection threads and scheduled procs.
>
>I suspect that this particular problem is probably unique for java
>integration, but I also suspect that each language integration is going
>to face its own particular hurdles.  Don't take this as a criticism of
>aolserver.  Overall it's an impressive piece of software, with clean
>interfaces and a simplicity of form that you rarely see in such a large
>application.
>
>Dan

Does JVM loose ability to intercept termination signals by having been
initialized in a separate thread? I.e., does above suggestion mean AOLserver
will intercept SIGTERM, but whatever TERM handler was potentially
established by JVM will not fire?

I work on JK2 module which runs Jakarta/Tomcat in-process. Somehow I don't
see evidence of JVM shutting down with AOLserver when I trace the process in
debugger. I wonder if that is due to separate-thread initialization of JVM.
Does anyone have insight on this?

Approaching the same issue from a different angle, does it even matter that
explicit JVM shutdown doesn't happen? It would if there were such a thing as
"shutdown servlet", which I don't see in servlets standard. Am I correct here?

I did try the case where JVM was initialized from AOLserver's main thread.
No apparent negative effect, including garbage collection problems (I
conducted a load test and saw no evindence of memory leak, which is how
garbage collection problem would manifest itself).

Thanks for your insight!
Alex

Reply via email to