This is the mail archive of the gcc-help@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: Basic Question on Building Multi-Threaded 'C' Apps with gcc


Frank Tufano writes:

 > I am developing a multi-threaded application (written in 'C') on
 > Linux on the AMD x86-64 platform.  I would like to know what
 > compile and link options I should be specifying to ensure that the
 > application builds properly.  (We are using the posix thread
 > model).  The only thread related option info I can find in the AMD
 > x86-64 Options section of the online manual is the -mthreads
 > option, which is for "thread-safe exception handling on `Mingw32'",
 > which is not applicable.  Below is my gcc version info and some
 > system info.

The only specific option you will need is `-pthread'.  This should do
everything that's needed to compile and link correctly in a
multi-threaded environment.

Andrew.

-- 
Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SL4 1TE, UK
Registered in England and Wales No. 3798903


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