<div dir="ltr">Hi,<div>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. </div><div><br></div><div>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.</div><div><br></div><div>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:</div><div><a href="https://gist.github.com/mshockwave/b314eb78d4019e7e106e705e864e0398">https://gist.github.com/mshockwave/b314eb78d4019e7e106e705e864e0398</a> </div><div>to power RWMutex.<br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Bekket McClane<div>Department of Computer Science,</div><div>National Tsing Hua University</div></div></div>
</div></div>