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: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable


On Wed, 14 Aug 2019, Alistair Francis wrote:

> > The pattern we have previously discussed for 64-bit time support is that
> > the code should (a) define the function (__thrd_sleep_time64, say) for
> > 64-bit time (which then only needs conversions in the reverse direction -
> > if the 64-bit syscall is not in fact available, but the 32-bit one is),
> > (b) if __TIMESIZE != 64, defines the 32-bit function as a thin wrapper
> > round that, (c) in the appropriate internal header, has a #define of the
> 
> Doesn't having a thing wrapper around __thrd_sleep64() result in
> unnecessary conversions? When __NR_clock_nanosleep_time64 is not

The conversions are in userspace, i.e. a few instructions.

We need a clearly defined consistent convention for the pattern used for 
function implementations for 32-bit and 64-bit time, not every function 
doing things in its own way.  For functions such a 
pthread_mutex_timedlock, with hundreds of lines of code, thin wrappers are 
clearly the only reasonably approach to avoid large amounts of code 
duplication.  That in turn leads to using thin wrappers consistently 
everywhere the functions are defined in C, unless there is a clear reason 
for a particular function to be different.

-- 
Joseph S. Myers
joseph@codesourcery.com


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