[Patch] C1X threading support

Daniel Eischen deischen at freebsd.org
Mon Dec 19 15:37:29 UTC 2011


On Mon, 19 Dec 2011, David Schultz wrote:

> 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.)

I agree, we probably want external definitions in case one needs
to interface to the functions from a different language.  Also,
please symbol version the library.

-- 
DE


More information about the freebsd-threads mailing list