This is the mail archive of the java-patches@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: WIN-02: get boehm-gc autodetect if it is compiled as a DLL



"Boehm, Hans" <hans_boehm@hp.com> writes:
> > I'm interested in supporting threads in statically linked gcj
> > binaries; could we add a way for libgcj's java.lang.Thread to notify
> > boehm-gc when threads are created? If you let me know what function to
> > call (I assume it should be called from the new thread's context), I
> > will insert the call in win32's natThread.cc.

> Right.  It needs to scan the stacks.  It also needs to temporarily stop the
> threads.
> 
> The relevant code is not currently a separate function in the win32 case.
> It's the DLL_THREAD_ATTACH/DETACH case in DllMain in win32_threads.c.
> 
> Looking at the code in win32_threads.c (I didn't write much of it), it might
> actually be easier to just use the Windows CE code in the same file.  I
> would guess that's not far away from working on win32.  It mostly defines a
> GC-aware replacement for CreateThread().  This is much closer to what the
> pthread support implementations do, and should work fine with static
> libraries.

That sounds like a good approach. I'll do that then.

Will this cause problems if libgcjgc _is_ built as a dll? In other
words, if the thread is automatically registerd with the GC, and then
registered again via the GC-aware CreateThread(), will the
double-registration cause problems?

  - a


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