Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Utility: add a Windows path to the synchronisation support #603

Merged
merged 1 commit into from
May 31, 2023

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