Question: single CPU usage
Jack Lloyd
lloyd@acm.jhu.edu
Thu Aug 16 11:36:00 GMT 2001
On Thu, 16 Aug 2001, Joy Woodford wrote:
> I have been advised that gcc will only use one CPU on any machine that
> it is running. Is this true? Are there any plans to make gcc take
> advantage of additional CPUs in a system?
There is no need to do so; your build tools can handle this for you. For
example, doing
make -j N foo
will build foo running at most N jobs in parrallel (with most makes; some
don't have this feature - use GNU make if yours doesn't). Presuming that
your OS is SMP-aware and you have N CPUs, your compilation will use all of
them. If you're refering to parrelelizing the interals of GCC (ie,
compiling a single file will use all available CPUs via with threads or
something), that would probably be pretty hard.
Jack
More information about the Gcc
mailing list