Skip to content

FEXCore: Use WritePriorityMutex for Code Invalidation Mutex #5408

Merged
lioncash merged 2 commits intoFEX-Emu:mainfrom
Sonicadvance1:129
Apr 6, 2026
Merged

FEXCore: Use WritePriorityMutex for Code Invalidation Mutex #5408
lioncash merged 2 commits intoFEX-Emu:mainfrom
Sonicadvance1:129

Conversation

@Sonicadvance1
Copy link
Copy Markdown
Member

The previous ForkableSharedMutex using std::shared_mutex was showing
up as significant CPU time on arm64ec. In particular it was showing up
upwards of 700ms/S of CPU time for read-contented workloads at only
~2700 locks per second. The libc++ implementation for arm64ec must be
particularly gnarly for this to be so slow.

With this swapped over, it's now only spending around 56ms/S on the
contended shared lock, but at ~8000 locks per second. So a significant
uplift.

The previous `ForkableSharedMutex` using `std::shared_mutex` was showing
up as significant CPU time on arm64ec. In particular it was showing up
upwards of 700ms/S of CPU time for read-contented workloads at only
~2700 locks per second. The libc++ implementation for arm64ec must be
particularly gnarly for this to be so slow.

With this swapped over, it's now only spending around 56ms/S on the
contended shared lock, but at ~8000 locks per second. So a significant
uplift.
@lioncash lioncash merged commit 51144c9 into FEX-Emu:main Apr 6, 2026
13 checks passed
@Sonicadvance1 Sonicadvance1 deleted the 129 branch April 6, 2026 23:49
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