Skip to content

Choice of Slim RW Lock over Critical Section for std::mutex? #4126

Closed Answered by CaseyCarter
danieljennings asked this question in General
Discussion options

You must be logged in to vote

IIRC, Windows folks told us to prefer SRW when the threading primitives were last overhauled in 2016 (which changes we haven't been able to ship due to the joys of ABI stability). I don't have hard numbers to hand, but I'd be surprised if the implementer, who was our perf champ at the time, didn't do some performance investigation as well.

I will note that SRW's ease of construction also makes it possible for us to make std::mutex's constructor constexpr as required by the Standard since C++11.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@CaseyCarter
Comment options

Answer selected by StephanTLavavej
@danieljennings
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants