Skip to content

Conversation

@compnerd
Copy link
Member

Use a SRWLOCK on Windows to support locking. Slim Reader-Writer locks are lightweight mutexes that closely resemble pthread_mutex_t in functionality. While possible to use WaitOnAddress to implement os_unfair_lock, that would be more complex and a slightly heavier mutex as a starting point seems reasonable. If it turns out that the performance really requires an even lighter weight locking primitive, we can refine this to WaitOnAddress subsequently.

Use a `SRWLOCK` on Windows to support locking.  Slim Reader-Writer locks
are lightweight mutexes that closely resemble `pthread_mutex_t` in
functionality.  While possible to use `WaitOnAddress` to implement
`os_unfair_lock`, that would be more complex and a slightly heavier
mutex as a starting point seems reasonable.  If it turns out that the
performance really requires an even lighter weight locking primitive, we
can refine this to `WaitOnAddress` subsequently.
@compnerd
Copy link
Member Author

@swift-ci please test

@compnerd compnerd merged commit 8981c51 into swiftlang:main May 31, 2023
@compnerd compnerd deleted the synchronisation branch May 31, 2023 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants