This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: __ASSUME_PRIVATE_FUTEX and __ASSUME_FUTEX_CLOCK_REALTIME


> Several of the pthread data structures combine the availability of
> private futexes and the choice the user makes into a final flag on data
> structure initialization time (futex_private_if_supported in my new API
> is a helper function for that).  We could do that, and then futex_*
> don't need to check/transform on the calls.  Alternatively, we could
> check whether the requested private/shared is actually supported during
> each futex_* call, and adapt accordingly.  The latter might be a tiny
> bit of overhead, but futex_* calls are basically always on slow paths.
> If we can do the latter, we can remove futex_private_if_supported and
> all that.

I recognize that overhead on slow paths matter little and that tiny
overheads matter not much more.  But I still think we should go for early
transformation into the forms that need the least work and/or storage
later.  Partly it just seems like a close to zero-sum trade-off between
doing work early and doing it later, and since early means once per object
and later means once per use (worst case), might as well choose the better
one even if it's negligibly better in practice.  But also it just seems
right to fold together the input validation with the transformation to
internal forms, and we always have some amount of input validation anyway.


Thanks,
Roland


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]