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]
Other format: [Raw text]

Re: CNI threads and garbage collection on FC4


On Fri, 2005-08-26 at 14:35 -0700, Andi Vajda wrote:
> You cannot create a thread and pass it to java after the fact. The gc 
> subsystem doesn't support that, yet. Hans Boehm, its author, intends to 
> support this eventually....

When you say after the fact, after what exactly do you mean?

CNI has this invocation interface...

http://gcc.gnu.org/onlinedocs/gcj/Invocation.html#Invocation

that includes an example of calling java from a C++ thread. It seems
like the JvAttachCurrentThread(NULL, NULL) function serves no purpose if
it can't be used to attach other threads to the JVM.

Do you mean it only works if you call java code from the main thread,
but not from threads created by pthread_create?

If so, I don't need garbage collection, I'm happy to delete the objects
manually. I just need to call
java::io::ObjectOutputStream::writeObject() from a C++ thread. Can I
tell the garbage collector not to run somehow?

Thanks,
Ryan


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