This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: CNI invocation API proposal
- To: Joerg Brunsmann <joerg_brunsmann at yahoo dot de>
- Subject: Re: CNI invocation API proposal
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Wed, 18 Apr 2001 21:29:27 +1200
- CC: Jeff Sturm <jsturm at one-point dot com>, java at gcc dot gnu dot org
- References: <20010418080536.97976.qmail@web5406.mail.yahoo.com>
Joerg Brunsmann wrote:
> Stupid question: if the gcj environment is created
> without a main function thread do we still need
> a "termination loop" which waits for termination of
> all other threads? Or will the gcj environment
> (javavm) will automatically be closed if all
> thread terminate?
There needs to be some way to execute VM shutdown actions (ala the Java 1.3
ShutdownHook API). These should always be run regardless of how the runtime
was started and how it is shutdown (Ctrl-C shouldn't prevent shutdown hooks
being run, etc).
Its probably possible to do this without a "sentinel" thread, but it might
make things more complex and less portable, so I'm inclined to stick with the
existing approach unless there's a good reason to change it. The
JvAttach() function or whatever would just need to check if the sentinel has
already been started, and start one if it hasn't. Currently we don't
implement the ShutdownHook stuff but there are certainly places that could
use it: eg cleanup of files created by File.createTempFile().
regards
[ bryce ]