This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Re: GCJ + Roguewave Threads?
- From: Andi Vajda <andi at osafoundation dot org>
- To: "Prabhakar, Vijay (IT)" <Vijay dot Prabhakar at morganstanley dot com>
- Cc: java at gcc dot gnu dot org
- Date: Thu, 10 Feb 2005 14:51:35 -0800 (PST)
- Subject: Re: GCJ + Roguewave Threads?
- References: <B02B40763A4E244B85073170FFFE10882C984D@NYWEXMB27.msad.ms.com>
- Reply-to: Andi Vajda <andi at osafoundation dot org>
Has anyone had experience or gotten GCJ to work with Roguewave threads?
I'm trying to get a set of Roguewave threads to attach to the VM via the
JvAttachCurrentThread() method and the program seems to crash in the
boehm-gc. Alternatively, I've tried to create the VM while in the thread
and then attach it, and it crashes in gc_push_all_eager in mark.c, near
line 1349. I'm using gcc 3.2.3-42.
I've tried to get something similar to work with threads created by python.
I took the same approach you describe and, with several hacks, got it to work
reliably only on Mac OS X. On Linux, with a 2.6 kernel, the process is
instantly killed, and on Windows (with mingw), I was not able to get threads
unregistered, so the process would crash after 253 or so threads.
Eventually, I realized I was doing it backwards and the new approach I'm
taking works very well on all 3 operating systems: have python delegate the
creation and initialization of the thread to libgcj and then have it play
tricks to make it think it is one of its own. Essentially, I'm creating two
thread objects, one in python and one in Java, both sharing the same OS
thread, with the python thread object delegating some essential API calls
such as start(), join(), etc... to the java thread object.
Andi..