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: GCJ + Roguewave Threads?


On 11-Feb-05, at 7:37 PM, Johann Hibschman wrote:

On Fri, 11 Feb 2005 13:29:45 -0500, Bryce McKinlay <mckinlay@redhat.com> wrote:
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.

Seems reasonable - just be sure to synchronize the threads correctly if
you take this route.

Well, I can't seem to get it to work. After I initialize the JVM, all subsequent calls to pthread_exit(NULL) simply hang.


Is there any reason why you need to call pthread_exit()? I suggest:

- Don't call pthread_exit
- Only JvAttach/JvDetachThread the thread which will be making Java calls, not your main thread
- pthread_join the Java thread you created


Be warned that creating short lived threads very often might be slow!

Regards

Bryce


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