clarification on use of --enable-threads

Nathan Sidwell
Fri Dec 3 20:07:00 GMT 2004

Aniruddha Jahagirdar wrote:
> --- Nathan Sidwell <> wrote:
>>Aniruddha Jahagirdar wrote:
>>>Why does the compiler (gcc) have to know in advance what threading model is it be used on the
>>>given machine ? 
>>>How does specification of the threading model affect exception handling ?
>>>Can't I build code that uses threading if --enable-threads is not supported on the platform I
>>>using (example - alphaev56-dec-osf5.1) ?
>>the runtime library needs to lock certain objects to ensure correct
>>operation.  It therefore needs to know how to do that.  Static object
>>construction and exception handling come to mind.
> So, does this mean that I can use any threading model ( say sun or posix ) on a given platform (
> alphaev56-dec-osf5.1 ) as long I link my source-code with the proper threading library ?

you can use any threading model that is *supported* on your platform.
If you configure with --enable-threads, the default for your platform
will be selected.  Configuring with --enable-threads=MODEL will configure
with that model (but MODEL needs to be a supported one)


Nathan Sidwell    ::   ::     CodeSourcery LLC    ::

More information about the Gcc mailing list