[4671] in java-interest

home help back first fref pref prev next nref lref last post

Re: -No Subject-

daemon@ATHENA.MIT.EDU (Arthur van Hoff)
Wed Jan 10 14:26:09 1996

Date: Wed, 10 Jan 1996 09:41:11 -0800
From: Arthur.Vanhoff@Eng.Sun.COM (Arthur van Hoff)
To: Dean_Burson.LOTUS@crd.lotus.com
Cc: java-interest@java.Eng.Sun.COM


Hi Dean,

> If I call a native C DLL from a java class method, the javaThis pointer is
> is implicitly passed along as the first parameter. I've been using the pointer 
> to call back into the java class using execute_java_dynamic_method. 
> 
> Can the java garbage collector see that the pointer is held by a native
> method? 

Yes, but only if it is held in a local variable. Don't put it in a static
variable or a heap data structure.

> Are there scoping rules for using the pointer in the native code? 

No, as long as the pointer stays in a local variable. So effectively
they are scoped by the duration of the native method invokation.

> Does the native method run in the same thread as the java method which 
> called it?
 
Yes. The threads are real threads.

> Happy to have it working, I'm curious to know when it will break.

Have fun,

	Arthur van Hoff
	
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post