sideeffects / HoudiniEngineForUnreal

Houdini Engine Plugin for Unreal Engine.
http://www.sidefx.com/unreal
Other
1.36k stars 374 forks source link

100% load of one CPU core in UE 4.25 #129

Closed unreal-skif closed 4 years ago

unreal-skif commented 4 years ago

Steps to reproduce:

  1. Run UE4, open any project, minimize UE4
  2. Observe UE4 CPU usage in Task Manager. It should be ~0%
  3. Enable the Houdini Engine plugin. Restart UE4
  4. Open the same project, minimize UE4
  5. Observe UE4 CPU usage in Task Manager

Result: one of the CPU cores is fully loaded Expectation: CPU usage by UE4 is ~0% in minimized state

I suppose it is due to zero sleep time in function FHoudiniEngineScheduler::ProcessQueuedTasks(): if ( FPlatformProcess::SupportsMultithreading() ) { // We want to yield for a bit. FPlatformProcess::Sleep( 0.0f ); } The issue is eliminated if sleep interval >0: if ( FPlatformProcess::SupportsMultithreading() ) { // We want to yield for a bit. FPlatformProcess::Sleep( 0.01f ); }

dpernuit commented 4 years ago

Hi, You're right, that's actually something I had already changed in version 2 of the plugin. I'll backport that change to v1 as well.