This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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: [incremental] Patch: FYI: initial threading in gcc


>>>>> "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


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