CNI invocation API proposal
Jeff Sturm
jsturm@one-point.com
Wed Apr 18 12:05:00 GMT 2001
On 2001年4月18日, Bryce McKinlay wrote:
> 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().
Good point. ISTR Tom had another reason for _Jv_ThreadWait, perhaps
something to do with quick threads.
Anyway, this sentinel thread may not be needed on platforms with adequate
support (Solaris threads?) and wouldn't necessarily be the primordial
thread as it is now. Its very existence may turn out to be a
implementation detail and not part of the gcj thread specification.
Note that linux pthreads starts a manager thread of its own, so that
currently the minimum number of threads to run a gcj application on linux
is three.
Jeff
More information about the Java
mailing list