This is the mail archive of the java@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: invocation interface


Bryce McKinlay <bryce@waitaki.otago.ac.nz> writes:

> 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.

My proposal is that you would have to call
        JvCreateJavaVM (NULL);
before JvAttachCurrentThread.  See my example program.  JvRunMain
also calls JvCreateJavaVM.

I'm unsure whether JvCreateJavaVM should do PROCESS_GCJ_PROPERTIES.

> 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().

Where are the shutdown hooks currently handled?  I didn't see them
in the code I changed.

Currently, FirstThread contains the getMain methods to find the
main method of a jar.  It seemed easier to keep that as Java code,
but it might be reasonable to merge it with some other class.
-- 
	--Per Bothner
per@bothner.com   http://www.bothner.com/per/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]