This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: glibc -- ISO C11 threads Proposal
- From: Rich Felker <dalias at aerifal dot cx>
- To: Carlos O'Donell <carlos at redhat dot com>
- Cc: Roland McGrath <roland at hack dot frob dot com>, Kevin Cox <kevincox at kevincox dot ca>, Torvald Riegel <triegel at redhat dot com>, libc-alpha at sourceware dot org
- Date: Thu, 27 Mar 2014 01:26:26 -0400
- Subject: Re: glibc -- ISO C11 threads Proposal
- Authentication-results: sourceware.org; auth=none
- References: <53260E7E dot 8070308 at kevincox dot ca> <1395771092 dot 19076 dot 1236 dot camel at triegel dot csb> <5331C7EA dot 6050407 at redhat dot com> <1395777699 dot 19076 dot 1469 dot camel at triegel dot csb> <20140325212732 dot GC26358 at brightrain dot aerifal dot cx> <53337E8B dot 50508 at kevincox dot ca> <20140327015642 dot GF26358 at brightrain dot aerifal dot cx> <20140327023659 dot E74C57449C at topped-with-meat dot com> <53339820 dot 8050800 at redhat dot com>
On Wed, Mar 26, 2014 at 11:16:48PM -0400, Carlos O'Donell wrote:
> On 03/26/2014 10:36 PM, Roland McGrath wrote:
> >> So in that case, the object sizes (for ABI purposes) will match the
> >> pthread ones. Is that ok with everyone?
> >
> > We haven't discussed the broader ABI plan for these interfaces at all yet.
> > My inclination for all new major subsystem sort of interfaces is to add
> > them in ways that minimize and/or compartmentalize our permanent ABI
> > commitment. Strictly minimizing would mean things like just having
> > statically-linked wrappers in lib*_nonshared.a, so in this instance there
> > might be no new ABI load at all--just compile-time wrappers around existing
> > pthread ABIs. (I'm not particularly advocating that, it's just an
> > example.)
>
> That seems like a option as long as it's possible to do that and meet
> the requirements of the standard.
It's not an option with the current libpthread since the namespace
would be violated. Also, this nonshared approach makes a MUCH WORSE
ABI problem than doing things the right way; consider what happens
when the main program was linked against one version of the nonshared
lib, one of the .so's it uses was linked against a different version
of it, and both are using C11 threads. Please, don't take us down that
road.
The size of the synchronization objects needs to be a fixed ABI that's
intended not to change, and that will be adjusted with symbol
versioning if it ever does change. (Note: symbol versioning does
nothing for the API breakage which becomes ABI between multiple
third-party libraries/applications using these types.) Then everything
else can be changed freely in the internals without breaking
applications or libraries using C11 threads. I believe the pthread
types are plenty large to give the needed flexibility for any
reasonable implementation of C11 threads, and while smaller types
would probably also work, I think using the exact same sizes is a
simple choice that's also nice in that it allows (but doesn't require)
implementing the C11 functions using the pthread ones.
Rich