stride3d / stride3d/stride

Large CPU Hang due to Stride.Core.Threading on Windows

Open
#2,635 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
7.8k
Forks
1.2k
Avg merge
2d 17h
Merged PRs (30d)
49

Description

Release: 4.2.0.2293

Platform: Windows 11

I have been using the stride engine just fine until today when suddenly even the most trivial stride templates (like the default ball) took 100% of all cores of my CPU. It led to massive freezing of my computer and the inability to do much of anything with stride. I am assuming something changed though what - I am not sure.

To Reproduce: Unfortunately I have no idea how to reproduce this... I cleaned and reinstalled everything to do with stride (.NET, MSBuild, VS etc.) but still didnt go away. I am assuming this must be a windows update?

Screenshots
I did some profiling to find where it was happening:

Image

As you can see there is a massive portion of time being consumed on the wait call of LowLevelInfoSemaphore.Wait.

I downloaded and built my own latest version of stride - same problem

Temporary Fix
I bypassed Stride.Threading to System.Threading and it works normally again

     public unsafe void QueueWorkItem([NotNull, Pooled] Action workItem, int amount = 1)
     {
         for (int i = 0; i < amount; i++)
             System.Threading.ThreadPool.QueueUserWorkItem((o) => workItem());
         return;

etc.

Let me know if you want me to dig further into this!

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by examining the profiling evidence around Stride.Threading's LowLevelInfoSemaphore.Wait and compare it with the reported System.Threading.ThreadPool workaround. Reproduce the Windows 11 high-CPU behavior if possible, then confirm that the threading path no longer consumes all CPU cores under the affected templates.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
game-dev, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.