microsoft / microsoft/wil

Revisit lock-free ThreadLocalStorage storage management

Open
#542 1 comment 2 reactions 2 assignees View on GitHub

@jonwis is already working on this.

Since Jan 4, 2026.

Dominant language
C++
Stars
3k
Forks
300
Avg merge
19h 12m
Merged PRs (30d)
1

Description

https://github.com/microsoft/wil/blob/master/include/wil/result.h#L403-L430

Internal analysis suggests that this sequence is not entirely thread safe. Some options include:

  • Use an srwlock-per-bucket (costs a function call)
  • Figure out the right sequence of acquire/release semantics for reading the hashtable bucket entries' starting pointer
  • Spin gently (using the platform's "yield" instructions as necessary)
  • Deeper analysis to prove safety with annotations and documentation

Thanks to @sudhakar-vp-zz and @cpkleynhans for the analysis! (See OS PR#13582094)

Contributor guide

No contributing guide indexed for this repository

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.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.