Open
Conversation
Author
|
Implementation details: https://github.com/lhmouse/mcfgthread/blob/ed201825f6d9298def77bc7c29aa1a8f86d634bb/MUTEX.md |
The mcfgthread library <https://github.com/lhmouse/mcfgthread> implements fast mutex and condition variables on Windows. To test mcfgthread, it's necessary to set up an environment in an MSYS2 UCRT64 shell: # pacman -S mingw-w64-ucrt-x86_64-{cmake,pkgconf,ninja,boost,mcfgthread} # cmake . # ninja # ./MutexShootout.exe Usage: D:\lh_mouse\GitHub\MutexShootout\MutexShootout.exe threadCount nolocks|std|boost|cs0|cs4k|srw|mcf|mcf0i `mcf` allows the locking and unlocking functions to be inlined, while `mcf0i` calls external functions. Results: $ ./MutexShootout.exe 16 srw srw_mutex: 29.3014 $ ./MutexShootout.exe 16 mcf mcf_mutex: 14.2265 $ ./MutexShootout.exe 16 mcf0i mcf_mutex (noinline): 13.4116 Signed-off-by: LIU Hao <lh_mouse@126.com>
Author
|
Here are test results on Windows 11 on ARM 24H2 (Dev channel) on Huawei MateBook E Go 2023, with an 8-core Snapdragon 8cx Gen 3, using Clang 18 as the compiler: 1 thread
4 threads
8 threads
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The mcfgthread library https://github.com/lhmouse/mcfgthread implements fast mutex and condition variables on Windows. To test mcfgthread, it's necessary to set up an environment in an MSYS2 UCRT64 shell:
mcfallows the locking and unlocking functions to be inlined, whilemcf0icalls external functions.Results: