This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: Complier options for multi core architecture systems
- From: Brian Dessent <brian at dessent dot net>
- To: pvssvikas <pvssvikas at gmail dot com>
- Cc: gcc-help at gcc dot gnu dot org
- Date: Thu, 25 Sep 2008 08:47:39 -0700
- Subject: Re: Complier options for multi core architecture systems
- References: <19666751.post@talk.nabble.com>
- Reply-to: gcc-help at gcc dot gnu dot org
pvssvikas wrote:
> Can any one please suggest me if there is/has been any work done on
> utilizing the multi core architecture with respect to gcc compiler.
>
> I'm looking for some support from the compilers to fine tune the code
> generation for an application which is being targeted to run on mutil-core
> hardware.
>
> It would be great if any of you could suggest some flags which can fine-tune
> the application for multi-core systems.
Parallelism is not a magic wand that you can just wave over code. It
requires careful study and design on the part of the programmer, in that
algorithms have to be chosen and implemented that can be split into
separate independent work units. gcc since 4.2 supports OpenMP which
does allow some loops to be automatically parallelized, but again this
requires specific programmer action to add markup to the code to direct
the compiler.
On the other hand, you don't need any special compiler support to write
multi-threaded programs, using whatever thread API your platform
supports (e.g. pthreads.)
Brian