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

ConcurrentRequestQueue - Reduced SpinCount to 15, before monitor wait #5344

Merged
merged 1 commit into from Sep 9, 2023

Conversation

snakefoot
Copy link
Contributor

@snakefoot snakefoot commented Sep 9, 2023

Double performance in synthetic benchmarks, when using OverflowAction=Block

Maybe the reason is that the DotNet Task Dispatcher is very good at giving high priority to dedicated threads running at full speed, thus delaying the handling of timer-events. There was actually a bug in dotnet 6.0.000 where the DotNet Task Dispatcher would never schedule timer-events as long other thread-task was pending. This was improved a little with Dotnet ver. 6.0.400, but timer-events still seem to have lower priority.

This means that if having 2 thread spinning hard, then it will delay the scheduling of the background timer-event, thus their spinning will actually introduce an unwanted "pause". But when reducing the spinning, then it will also reduce the "pause"-effect. Seems the SpinCount upgrades to Sleep(1) after 20 iteration, which makes the "pause" even harder.

It is strange that timer-event are not scheduled when actually having more physical cores (4) than active threads (2). So maybe I'm experiencing something else.

@sonarcloud
Copy link

sonarcloud bot commented Sep 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

100.0% 100.0% Coverage
0.0% 0.0% Duplication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant