Threading the compiler

Geert Bosch bosch@adacore.com
Tue Nov 14 03:30:00 GMT 2006


On Nov 13, 2006, at 21:27, Dave Korn wrote:
>   To be fair, Mike was talking about multi-core SMP, not threading  
> on a single
> cpu, so given that CPU usage is at 100% now for most jobs, there is  
> an Nx100%
> speedup to gain from using 1 thread on each of N cores.

I'm mostly building GCC on multiprocessor CPUs and typically
run make -j (number_of_processors + 1).
>
>> The main place where threading may make sense, especially
>> with LTO, is the linker. This is a longer lived task, and
>> is the last step of compilation, where no other parellel
>> processes are active. Moreover, linking tends to be I/O
>> intensive, so a number of threads will likely be blocked
>> for I/O.
>
>   I'm not really sure how this would play with SMP (as opposed to  
> threading).
> I don't see why you think threading could be particularly useful in  
> the
> linker?  It's the pipeline of compiler optimisation passes that  
> looks like an
> obvious candidate for threading to me.

This would be when we do link-time optimizations. These optimizations
will be on much larger datasets and occur when with no work remaining
to do in parallel.

   -Geert



More information about the Gcc mailing list