This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
CNI threads and garbage collection on FC4
- From: Ryan Boder <icanoop at bitwiser dot org>
- To: java at gcc dot gnu dot org
- Date: Fri, 26 Aug 2005 15:25:37 -0400
- Subject: CNI threads and garbage collection on FC4
Hi,
I'm using CNI to convert C++ objects (data only, no methods) into java
objects and pass them over the network to java programs using
serialization. It works fine on my older machines with various versions
of GCC 3.x, but it causes a problem on my FC4 machine which has GCC
4.0.1 and libgcj 4.0.1.
I create several threads using pthread_create from C++ and I call
JvAttachCurrentThread(NULL, NULL) in each of them. The problem is when I
create new java objects libgcj throws an exception and prints
Collecting from unknown thread.
Aborted
I am sure that I only create java objects in threads that called
JvAttachCurrentThread(NULL, NULL) when they started. And this works on
all my machines except FC4.
Does anyone have any ideas? Is it possible to disable garbage collection
in CNI and delete the java objects manually? I need this code to work on
all recent distributions for it to be useful.
Thanks,
Ryan