This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc -- ISO C11 threads Proposal
- From: Torvald Riegel <triegel at redhat dot com>
- To: Kevin Cox <kevincox at kevincox dot ca>
- Cc: libc-alpha at sourceware dot org
- Date: Tue, 25 Mar 2014 19:11:32 +0100
- Subject: Re: glibc -- ISO C11 threads Proposal
- Authentication-results: sourceware.org; auth=none
- References: <53260E7E dot 8070308 at kevincox dot ca>
On Sun, 2014-03-16 at 16:50 -0400, Kevin Cox wrote:
> with the following additions (which may be renamed) which will be
> defined if _GNU_SOURCE is defined (this may be discussed and changed).
>
> /* Get the pthread_t corresponding to the passed in thread */
> pthread_t
> thrd_pthread(thrd_t thrd);
>
> /* Get the pthread_mutex_t corresponding to the passed in mutex */
> pthread_mutex_t *
> mtx_pthread(mtx_t *mtx);
>
> /* Get the pthread_cond_t corresponding to the passed in condition
> variable */
> pthread_cond_t *
> cnd_pthread(cnd_t &thrd);
>
I don't think adding these is a good idea. This would effectively bind
the C11 implementation to use these POSIX synchronization mechanism
forever (or vice-versa). Getting one of those standards to evolve is
already hard enough. Furthermore, the fact that you can implement C11
feature with POSIX today doesn't mean that C11's semantics are equal to
POSIX's.