invocation interface

Jeff Sturm
Wed May 16 06:42:00 GMT 2001

Bryce McKinlay wrote:
> By "FirstThread" I actually meant the "sentinal thread which sits in
> _Jv_ThreadWait waiting for all other non-daemon threads to die", not the
> gnu.gcj.FirstThread. The same behaviour could be acomplished by having each
> thread check how many other threads are running when it exits, but I'm not
> convinced that wouldn't make the code more complex and less portable.

How is this done with JNI?  The Sun JNI docs say DestroyJavaVM must not
be called until all non-main threads have terminated.  But it's not easy
to know when all threads have completed without the equivalent of

In the JDK 1.2 and higher the "java" launcher program uses JNI.  Perhaps
it never really calls DestroyJavaVM at all, but just falls off the end
of main?  This seems like a flawed design.


More information about the Java mailing list