CNI invocation API proposal
Bryce McKinlay
bryce@albatross.co.nz
Wed Apr 18 02:28:00 GMT 2001
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 ]
More information about the Java
mailing list