This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
RE: GCJ + Roguewave Threads?
- From: Johann Hibschman <johannh at gmail dot com>
- To: java at gcc dot gnu dot org
- Date: Thu, 10 Feb 2005 21:37:27 -0500
- Subject: RE: GCJ + Roguewave Threads?
- Reply-to: Johann Hibschman <johannh at gmail dot com>
(I'm working with Vijay on this; he's left for Vegas, baby.)
Hans Boehm wrote:
> I assume that Roguewave threads are a thin layer on pthreads?
Yes, they are.
> I think we still have a problem with notifying the GC of a new
> thread, if threads are created without going through GC_pthread_create.
> I need to find time to work on that.
Do you know of any documentation or examples of using
GC_pthread_create? I suppose I'll just look through the source
tomorrow.
To return this to gcj, the correct way to use multiple threads with
one JVM is to call JvCreateJavaVM once in the main thread, then create
subsequent threads via GC_pthread_create and call
JvAttachCurrentThread from within those threads?
> If the Roguewave implementation is in header files, and you can
> recompile the files that include it, you might be
> able to work around the problem by defining GC_THREADS and including
> gc.h before you include those header files. That will redefine
> pthread_create to the wrapper that notifies the GC.
I don't believe the implementation is all in the headers, but do I
have to define GC_THREADS in any gcj/c++ program that uses then?
Would the proper place to do this be right before the #include
<cni.h>, or are there other details to manage?
My hair-brained scheme for tomorrow is to see if I can launch a
proper, GC-registered pthread from the main thread, and then use that
thread for all subsequent gcj work, leaving the Rogue Wave threads to
do their dirty business in the original thread. This is only slightly
hampered by me never having used pthreads in my life. :-)
Thanks for the info,
Johann