This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [incremental] Patch: FYI: initial threading in gcc
- From: Tom Tromey <tromey at redhat dot com>
- To: Paolo Bonzini <bonzini at gnu dot org>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 12 Oct 2007 09:40:50 -0600
- Subject: Re: [incremental] Patch: FYI: initial threading in gcc
- References: <m3bqb5e7ls.fsf@fleche.redhat.com> <470F36E6.4090703@gnu.org>
- Reply-to: tromey at redhat dot com
>>>>> "Paolo" == Paolo Bonzini <bonzini@gnu.org> writes:
>> There are some limitations in the current patch. First, it assumes
>> pthreads and the existence of __thread. Fixing this is just some
>> boring configury, or perhaps figuring out how to re-use gthr* on the
>> host. (If __thread is not available, I plan to have the server fall
>> back to single-threaded mode.) Second, I haven't implemented PCH
>> support for thread-locals.
Paolo> 1) moving all globals to the heap or to GGC memory, so that they are
Paolo> at least in a shared address space
Paolo> I fear that the above might also mean implementing pointer-swizzling
Paolo> on PCH load, because you might need the same PCH in different threads.
I think this would only be an issue if we have an object on the heap
that contains the address of a thread-local variable. I don't know
whether that happens, but I doubt that it does.
So, I don't think we'll need to do full pointer swizzling on PCH load.
But, we'll have to arrange for the thread-locals to get their correct
values at startup. I haven't looked into this but I don't think it
should be very hard or very expensive.
I'm not planning to allow creating a PCH when there are multiple
threads running. That should simplify things a bit.
Tom