FirstThread

Jeff Sturm jsturm@sigma6.com
Wed Oct 27 08:50:00 GMT 1999


Tom Tromey wrote:
>> >>>>> "Jeff" == Jeff Sturm <jsturm@sigma6.com> writes:
>> Jeff> External threads must create a java.lang.Thread object when they
> Jeff> attach to the runtime, and register themselves with the GC so
> Jeff> their stacks will be scanned for pointers. I don't think it
> Jeff> would be hard to do this in libgcj... anybody else see a
> Jeff> problem?
>> Nope, provided it is still easy to port to new thread systems.
> This is a change I've wanted to make but I haven't found the time.

I don't think the thread layer would change much. Some functions may no
longer be needed, like _Jv_ThreadWait.
I've been thinking some about the interaction of threads with boehm-gc
though... every new thread system has to be ported twice. There is a
linux-threads.c port in boehm-gc and a corresponding posix-threads.c
port in libjava. Similar for quick-threads. Since everything boehm-gc
needs from the thread system can be done easily in libgcj (at least once
we have suspend/resume), why not just create one gcj-threads port in
boehm-gc and have it call back into libgcj? Or make it part of the GC
interface? Then we can do away with the nasty wrapper functions for
pthread_create and pthread_join...
-- 
Jeff Sturm
jsturm@sigma6.com


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /