[Patch] C1X threading support

David Schultz das at FreeBSD.ORG
Mon Dec 19 15:05:46 UTC 2011


On Sun, Dec 18, 2011, Ed Schouten wrote:
> Hi Jilles,
> 
> * Jilles Tjoelker <jilles at stack.nl>, 20111218 14:27:
> > Another idea is to implement the functions as static inline (with the
> > possible exception of thrd_create() and perhaps some more). This
> > pollutes the namespace of C1x programs with pthread_* though.
> 
> Hmmm... Indeed. This would change the entire C1X threading API simply
> into a compile-time translation mechanism to pthreads. Unfortunately, it
> would make things like debugging a bit harder, as placing breakpoints on
> the functions become a bit harder.
> 
> Are there any objections to such an approach?

Technically there's a requirement that external definitions be
provided.  Applications that break if you don't are pretty rare, but
why not do it right by providing some wrappers or symbol aliases in
the library?  Nothing precludes you from also defining a non-static
inline function in the header file (but note that you may need an ifdef
to handle the differences between GNU and C99 inlines.)


More information about the freebsd-threads mailing list