You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by Vasile GABURICI <ga...@ss.pub.ro> on 2000/05/18 22:26:47 UTC

AOLServer plugin now works better on Linux

	I have received invaluable support from Juergen Kreileder from
Blackdown Java-Linux Team. He identified why the JVM was hanging, and it
was indeed related to the GC. Gal was right about this, but his info on
SIGUSR1 doesn't apply to Blackdown JDK 1.2.2-RC4.

	The Blackdown JDK only uses real time signals. These were
introduced in glibc 2.1. Also noteworthy is that glibc 2.1 no longer uses
SIGUSR1 for Linux threads. Instead it uses SIGRT_0, 1 and 2.

	The scoop was that the main thread in AOLServer does the
initialization of modules, launches a dispatcher thread that deals with
connections, and then goes into a signal handling loop, where it uses
sigwait().

	Because I was using the main thread to launch the JVM, it was
considered a Java thread by the GC, and it tried to suspend it. This
didn't work because the main thread was sigwaiting(). So the GC hanged.
And every other Java thread was suspended by the GC!

	Why did the voodoo with sending a signal handled by the main
thread resulted in the JVM being unjammed? When a signal arrived that
matched the list in sigwait(), the main thread exited that system call,
and immediately got hit by the pending real time signal. Which in turn
resulted in the GC getting its work done.

	The fix was to put the JVM initialization routine in a separate
thread, that doesn't sigwait().  I have released a new version of my
plug-in that implements just that and it works wonderfully with Blackdown
JDK 1.2.2-RC4. Anybody interested can get it from my page:
http://kermit.ss.pub.ro/~gaburici/nstomcat/

	Unfortunately, this fix breaks completely in IBM JDK 1.1.8.
Threads hang when they try to attach to the JVM. And because the signal
handling thread is no longer attached to the JVM, there is no unjam
button.

	IMHO, better to have the plug-in in good working order on one JDK,
rather than have it partially working on two...

	That's it for tonight.


	Cheers,
	Vasile



RE: AOLServer plugin now works better on Linux

Posted by "Preston L. Bannister" <pr...@home.com>.
You might want to bounce this off the IBM newsgroup:

  news://news.software.ibm.com/ibm.software.java.linux

As there usually seems be someone from the development team
present - and I imagine they might have interest in this :).

> -----Original Message-----
> From: Vasile GABURICI [mailto:gaburici@ss.pub.ro]
> Sent: Thursday, May 18, 2000 1:27 PM
> To: tomcat-dev@jakarta.apache.org
> Subject: AOLServer plugin now works better on Linux
> 
> 
> 
> 	I have received invaluable support from Juergen Kreileder from
> Blackdown Java-Linux Team. He identified why the JVM was hanging, and it
> was indeed related to the GC. Gal was right about this, but his info on
> SIGUSR1 doesn't apply to Blackdown JDK 1.2.2-RC4.
> 
> 	The Blackdown JDK only uses real time signals. These were
> introduced in glibc 2.1. Also noteworthy is that glibc 2.1 no longer uses
> SIGUSR1 for Linux threads. Instead it uses SIGRT_0, 1 and 2.
> 
> 	The scoop was that the main thread in AOLServer does the
> initialization of modules, launches a dispatcher thread that deals with
> connections, and then goes into a signal handling loop, where it uses
> sigwait().
> 
> 	Because I was using the main thread to launch the JVM, it was
> considered a Java thread by the GC, and it tried to suspend it. This
> didn't work because the main thread was sigwaiting(). So the GC hanged.
> And every other Java thread was suspended by the GC!
> 
> 	Why did the voodoo with sending a signal handled by the main
> thread resulted in the JVM being unjammed? When a signal arrived that
> matched the list in sigwait(), the main thread exited that system call,
> and immediately got hit by the pending real time signal. Which in turn
> resulted in the GC getting its work done.
> 
> 	The fix was to put the JVM initialization routine in a separate
> thread, that doesn't sigwait().  I have released a new version of my
> plug-in that implements just that and it works wonderfully with Blackdown
> JDK 1.2.2-RC4. Anybody interested can get it from my page:
> http://kermit.ss.pub.ro/~gaburici/nstomcat/
> 
> 	Unfortunately, this fix breaks completely in IBM JDK 1.1.8.
> Threads hang when they try to attach to the JVM. And because the signal
> handling thread is no longer attached to the JVM, there is no unjam
> button.
> 
> 	IMHO, better to have the plug-in in good working order on one JDK,
> rather than have it partially working on two...
> 
> 	That's it for tonight.
> 
> 
> 	Cheers,
> 	Vasile
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tomcat-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tomcat-dev-help@jakarta.apache.org
> 
>