This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: WIN-02: get boehm-gc autodetect if it is compiled as a DLL
- From: Adam Megacz <patches at lists dot megacz dot com>
- To: java-patches at gcc dot gnu dot org
- Date: 31 Jan 2002 15:17:44 -0800
- Subject: Re: WIN-02: get boehm-gc autodetect if it is compiled as a DLL
- Organization: Myself
- References: <40700B4C02ABD5119F000090278766443BEF6D@hplex1.hpl.hp.com>
"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