[all-commits] [llvm/llvm-project] 9ddedf: [libc++] Deprecate the C++20 synchronization libra...

Louis Dionne via All-commits all-commits at lists.llvm.org
Tue Apr 16 07:58:10 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 9ddedf07ed80076e0e419940753aeaaf719a09ec
      https://github.com/llvm/llvm-project/commit/9ddedf07ed80076e0e419940753aeaaf719a09ec
  Author: Louis Dionne <ldionne.2 at gmail.com>
  Date:   2024-04-16 (Tue, 16 Apr 2024)

  Changed paths:
    M libcxx/.clang-format
    M libcxx/docs/ReleaseNotes/19.rst
    M libcxx/include/__atomic/atomic.h
    M libcxx/include/__atomic/atomic_flag.h
    M libcxx/include/__config
    M libcxx/include/barrier
    M libcxx/include/latch
    M libcxx/include/semaphore
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_all.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_notify_one.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait.pass.cpp
    M libcxx/test/std/atomics/atomics.types.operations/atomics.types.operations.wait/atomic_wait_explicit.pass.cpp
    M libcxx/test/std/thread/thread.barrier/arrive.pass.cpp
    M libcxx/test/std/thread/thread.barrier/arrive_and_drop.pass.cpp
    M libcxx/test/std/thread/thread.barrier/arrive_and_wait.pass.cpp
    M libcxx/test/std/thread/thread.barrier/completion.pass.cpp
    M libcxx/test/std/thread/thread.barrier/ctor.compile.pass.cpp
    M libcxx/test/std/thread/thread.barrier/max.pass.cpp
    M libcxx/test/std/thread/thread.latch/arrive_and_wait.pass.cpp
    M libcxx/test/std/thread/thread.latch/count_down.pass.cpp
    M libcxx/test/std/thread/thread.latch/ctor.pass.cpp
    M libcxx/test/std/thread/thread.latch/max.pass.cpp
    M libcxx/test/std/thread/thread.latch/try_wait.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/acquire.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/binary.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/ctor.compile.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/max.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/release.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/timed.pass.cpp
    M libcxx/test/std/thread/thread.semaphore/try_acquire.pass.cpp

  Log Message:
  -----------
  [libc++] Deprecate the C++20 synchronization library before C++20 (#86410)

When we initially implemented the C++20 synchronization library, we
reluctantly accepted for the implementation to be backported to C++03
upon request from the person who provided the patch. This was when we
were only starting to have experience with the issues this can create,
so we flinched. Nowadays, we have a much stricter stance about not
backporting features to previous standards.

We have recently started fixing several bugs (and near bugs) in our
implementation of the synchronization library. A recurring theme during
these reviews has been how difficult to understand the current code is,
and upon inspection it becomes clear that being able to use a few recent
C++ features (in particular lambdas) would help a great deal. The code
would still be pretty intricate, but it would be a lot easier to reason
about the flow of callbacks through things like
__thread_poll_with_backoff.

As a result, this patch deprecates support for the synchronization
library before C++20. In the next release, we can remove that support
entirely.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list