This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
- From: Joseph Myers <joseph at codesourcery dot com>
- To: Alistair Francis <alistair23 at gmail dot com>
- Cc: Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>, Arnd Bergmann <arnd at arndb dot de>, Adhemerval Zanella <adhemerval dot zanella at linaro dot org>, Florian Weimer <fweimer at redhat dot com>, Palmer Dabbelt <palmer at sifive dot com>, <macro at wdc dot com>, Zong Li <zongbox at gmail dot com>
- Date: Wed, 14 Aug 2019 20:15:06 +0000
- Subject: Re: [RFC v4 02/24] sysdeps/nanosleep: Use clock_nanosleep_time64 if avaliable
- Ironport-sdr: fzMVR9YWSGoZYcaJXueXZru0pzbWrzMEhMBVlJ0dqi41MzifkueeY5sIPUweCIfM1nVbqxgENt pSVDBx/qxcVLqN5vu9U0U64Lw5MGaA6hcUCOn1uIwK7aJl7mjBW0TeCbt9eN9LEurp6DBSeWB3 rBXzZdq6bmFjCy+kmhxIphaMxErYu64kai6so/aIr4AD8xWuCKd3o13oEf7L2EOhyVKCWCLVZ9 ytPyc17yG3C4qWe+RFG00A7TEZkGoBuJUwcwAXfPXepCpV3iXNoxN9kqhoJqAcg8NBM28ry4RH saI=
- Ironport-sdr: PdY5XpLEXL8MHsIXjrXbupTwlBDmGqSsGrQA5g3RaKb0EaeZ4cdO0KZ6XRpKZBmIjaSvCB6bp3 Mw1Ns2kuuIEXNCatmELrh3kDrrcWrZGRY8DezvWQNk2PGY55qGIbYXwwgqQek9CETY0ilgTB9u HvpRM+UUFlFz+bT5XTQVvniLFracY+cZzT2kuoNGmVDzxMcRhunMRePk3s2n/E7bRkuRiGvm2R E/aes72tqB+tOuPXSHprzs7Ze7i+zpYGhVxtbc6dAcNV9Bimpakgik1we/CynrinZrRCF1v5M1 0QI=
- References: <cover.1565398513.git.alistair.francis@wdc.com> <52963d258d46a3ab7eb045b4f1633ac09a5e46b4.1565398513.git.alistair.francis@wdc.com> <alpine.DEB.2.21.1908121700530.9732@digraph.polyomino.org.uk> <CAKmqyKNiqjOBS1u0RBNUTPK=HaBz8qbQK=gkj5Mr54FB3vgyRg@mail.gmail.com>
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