invocation interface

Bryce McKinlay bryce@waitaki.otago.ac.nz
Tue May 15 20:08:00 GMT 2001


Per Bothner wrote:

> I'm taking a look at a working Java invocation interface, including
> getting rid of the FirstThread.  I notice there is a
> _Jv_JNI_AttachCurrentThread function and a gnu.gcj.jni.NativeThread
> class.  Do these actually do anything?  I don't see where the
> NativeThread is connected to the current thread.

Yeah, this is currently unfinished and doesn't do anything useful.

> We'd need a new private Thread constructor, one that
> does not call currentThread ().
>
> The _Jv_JNI_AttachCurrentThread method would loosely be
> a wrapper around _Jv_AttachCurrentThread.
>
> The FirstThread and NativeThread classes would both go away.
>
> Comments?

This interface is pretty much what I've had in mind.  Note also that
there are runtime initialization functions which need to be run for GC
initialization etc, so AttachCurrentThread needs to check if the runtime
has been initialized yet and do so if neccessary.

I am dubious about the benefits of getting rid of the FirstThread,
however. If it is going to make the invocation interface simpler to
implement, then thats cool, but please keep in mind that we need a place
to execute ShutdownHooks which will run even if the application is
shutdown abruptly by say ctrl-C or SIGTERM, and if possible we'd want to
implement that without using non-portable functions like
pthread_kill_other_threads_np().

regards

  [ bryce ]




More information about the Java mailing list