gthread API for c++0x thread lib

Mark Mitchell mark@codesourcery.com
Fri Aug 8 21:31:00 GMT 2008


Chris Fairles wrote:

> libstdc++'s acinclude.m4 has machinery that executes "gcc -v" grepping
> out the "Thread model", then if the gthr-${thread_model}.h exists, it
> subts the filename (via glibcxx_thread_h) which is then used
> libstdc++'s Makefile.am to create a gthr-default.h using a rule that
> basically cats an #include line for the arch specific gthr-*.h into
> gthr-default.h and does some replacement of various macros using sed.

I don't have a concrete suggestion for what exactly to do; that's 
probably best addressed by the libstdc++ maintainers.  But, it's 
certainly a bad thing to provide interfaces that silently fail, and I 
think it would be best if this new functionality were entirely disabled 
(e.g., header files not installed) for platforms that do not support the 
API.

One thing that might work would be to determine the threading model as 
above, and then use AC_TRY_LINK to build a program that links with the 
new APIs.  If the link fails, then you know the gthread implementation 
in question doesn't implement the APIs you need, and you can turn off 
the new stuff.

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list