Bekket McClane via llvm-dev
2016-Oct-31 08:19 UTC
[llvm-dev] [Support/RWMutex] [RFC] Use std::atomic to replace platform-specific implementation
Hi, The old llvm::sys::RWMutex use platform-specific lock mechanism to implement read/write lock. For example, SRWLock on Windows and pthread read/write lock on *nix systems. However, in comparison with the approach that implement read/write lock base on std::atomic, the old methods not only has potential performance issue(Sorry I can't provide concrete evidence, any benchmark result is welcome) but also non-standard. Before std::shared_mutex in C++17 got fully adopt by LLVM codebase, I think we can use std::atomic + std::conditional_variable approach like this: https://gist.github.com/mshockwave/b314eb78d4019e7e106e705e864e0398 to power RWMutex. -- Bekket McClane Department of Computer Science, National Tsing Hua University -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161031/6c418aa7/attachment.html>
Apparently Analagous Threads
- [PM] Simple Tutorial for In-Tree Pass Integration
- [LLVMdev] Code/comment seems not synchronized in Mutex.cpp and RWMutex.cpp
- [RFC] Parallelizing (Target-Independent) Instruction Selection
- [LLVMdev] CMake does not work with LLVM anymore?
- [LLVMdev] Issue compiling LLVM 2.6 on Windows with MinGW