invoke GCJ .o files from C/C++ program
Bryce McKinlay
bryce@albatross.co.nz
Thu Jul 6 14:40:00 GMT 2000
Jeff Sturm wrote:
> This program dies sometime after printing "hello world" but I honestly
> didn't expect it to get that far. Now I'm wondering if the thread
> initialization, etc. couldn't be done as a side effect of class
> initialization (i.e. put the startup code in Thread.<clinit>) so the
> above would actually work, and JvRunMain would no longer be required?
As far as I know, the thread initialization thing is the only significant
issue that needs to be resolved to get "CNI invocation" working. The problem
is how to get Thread.currentThread() to return a reasonable value when the
current thread wasn't started with a "new Thread()" (and subsequently
pthread_create). Another thing that may need to be done is initialization of
the gc environment. These are things I've been
meaning to take a good look at for a while now...
Getting it to all run from the System.class or Thread.class initialization is
an excellent idea, certainly much preferable to adding additional APIs to the
CNI. However I'm not sure if it would work robustly, given that other
initializers that will be invoked recursively are potentially dependent on
the environment that would be set up here (eg may call synchronized {} or
wait() which would require threads to have already been initialized, etc...)
regards
[ bryce ]
More information about the Java
mailing list