-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Updating to .net 6 causes higher lock contention #108057
Labels
area-System.Threading
in-pr
There is an active PR which will close this issue when it is merged
tenet-performance
Performance related issue
Comments
dotnet-policy-service
bot
added
the
untriaged
New issue has not been triaged by the area owner
label
Sep 20, 2024
Do you see the same with .NET 8? .NET 6 goes out of support in two months. |
Yes, .NET 8 has the same issue. |
AlanLiu90
added a commit
to AlanLiu90/runtime
that referenced
this issue
Sep 23, 2024
For a worker thread, Thread.StartCore and Thread.SetThreadPoolWorkerThreadName have lock contention. Fix dotnet#108057
dotnet-policy-service
bot
added
the
in-pr
There is an active PR which will close this issue when it is merged
label
Sep 23, 2024
dotnet-policy-service
bot
removed
the
untriaged
New issue has not been triaged by the area owner
label
Sep 23, 2024
sirntar
pushed a commit
to sirntar/runtime
that referenced
this issue
Sep 30, 2024
…08135) For a worker thread, Thread.StartCore and Thread.SetThreadPoolWorkerThreadName have lock contention. Fix dotnet#108057
mikelle-rogers
pushed a commit
to mikelle-rogers/runtime
that referenced
this issue
Dec 10, 2024
…08135) For a worker thread, Thread.StartCore and Thread.SetThreadPoolWorkerThreadName have lock contention. Fix dotnet#108057
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
area-System.Threading
in-pr
There is an active PR which will close this issue when it is merged
tenet-performance
Performance related issue
Description
Recently, I upgraded our game server project to .net 6 from .net core 3.1 and observed
Monitor.LockContentionCount
became significantly higher during stress test. Using dotnet-trace, I found it's fromThread.SetThreadPoolWorkerThreadName
:Looking into the source code, it seems the contention is from the following code:
Although I haven't seen performance problem yet, but I think it causes some confusion when updating to .net 6 or later versions.
It looks like using
SetThreadPoolWorkerThreadName
instead of settingName
property is to avoid setting_mayNeedResetForThreadPool
. Is it better to modifiy the implementation to avoid this lock contention?Reproduction
The text was updated successfully, but these errors were encountered: