[lldb-dev] 64bit atomic ops on 32bit platforms
Joerg Sonnenberger via lldb-dev
lldb-dev at lists.llvm.org
Wed Aug 2 06:47:56 PDT 2017
Hi all,
there was a commit a while ago that effectively forces all LLVM projects
to use libatomics on 32bit platforms. It is completely necessary for
clang and LLVM, of limited usefulness for libc++ (<atomics> test cases)
and necessary for LLDB right now. The only instance in LLDB is
include/Utility/Timer.h for nanosecond-precise time accounting. While
the code is correct, it will be secretly using a mutex in the
implementation and therefore not be wait-free. This feels like somewhat
of a bad idea for an accounting tool, so I would like to:
(a) Make the mutex explicit if 64bit operations are not lock-free.
or
(b) Weaken the consistency constraints to provide eventually-consistent
times by splitting the field into explicit 32bit chunks. This makes the
write side get predictable timings at the expensive of the summaries
being potentially off a bit in the case of races.
Joerg
More information about the lldb-dev
mailing list