C11 threads ABI - mtx_t and cnd_t types

Torvald Riegel triegel@redhat.com
Mon Oct 6 13:18:00 GMT 2014


On Sat, 2014-08-30 at 22:52 -0400, Rich Felker wrote:
> Another issue I have on the ABI for C11 threads pertains to the types
> for mtx_t and cnd_t. My understanding, and I agree with this, is that
> it was already decided to use the same underlying sizes/alignment, and
> for now representations, as the corresponding POSIX types.

I don't remember a decision being made rather than just people
expressing their opinion at that time, but maybe I'm wrong.

Anyway, for mtx_t I'm starting to wonder whether a fresh start would
indeed be better, with some additional room for expanding the lock
representation to state elsewhere.  (That is, mtx_t would at least be
pointer-sized.)
The reason for this is the current discussion around the barrier
semantics.  It is slowly moving, and I'm concerned about the Austin
Group deciding to stick to the less efficient spec for mutexes after a
long discussion -- which would leave us with larger-than-necessary mtx_t
while not using the pthread_mutex_t implementation anyway.



More information about the Libc-alpha mailing list