Issue 131365
Summary [libc++] Decouple the notion of providing a threading API and having multiple threads of execution
Labels libc++
Assignees
Reporter ldionne
    Today, `LIBCXX_ENABLE_THREADS` controls both:
- whether libc++ provides a threading API, and
- whether libc++ assumes the platform to allow multiple threads of execution

However, some systems exist where we can't (or don't want to) provide the libc++ threading API, yet the platform does support multiple threads of executions. In the current model, we are forced to pick between:
- `LIBCXX_ENABLE_THREADS=ON`, which causes libc++ to attempt to provide a threading API and fails to build
- `LIBCXX_ENABLE_THREADS=OFF`, which causes libc++ to assume that there can't be multiple threads of executions, and results in the code not using synchronization primitives, atomics and other thread-safe things. This can result in race conditions on such platforms.

Both options are clearly bad, and we should fix that.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to