microsoft / microsoft/STL

`xlock.cpp`: Should we use `SRWLOCK` instead of `CRITICAL_SECTION`?

Open
#3,521 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

performance
Dominant language
C++
Stars
11.1k
Forks
1.7k
Avg merge
4d 15h
Merged PRs (30d)
22

Description

In #2317, MSVC STL dropped support for Windows Vista and make SRWLOCK unconditionally used for mutex. However, there're still some implementation details using CRITICAL_SECTION, all of which can be found in xlock.cpp (via xmtx.hpp and xmtx.cpp).

It seems that switching to SRWLOCK doesn't affect ABI (as support for Vista has been dropped). Should we do this?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading stl/src/xlock.cpp and the related paths in stl/src/xmtx.hpp and stl/src/xmtx.cpp. Compare the existing CRITICAL_SECTION implementation with the proposed SRWLOCK usage, then confirm whether the change preserves ABI and behavior after Vista support was dropped.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
operating-systems
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.