You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a large latency in how the cook completed state is synchronized between the Houdini application and the HoudiniSchedulerThread. This is causing an unnecessary random 0ms-100ms latency to get added to all cook operations.
This issue is similar to what I described in this PR: #309
A cook is performed on the HoudiniSchedulerThread by calling FHoudiniApi::CookNode. (See: FHoudiniEngineScheduler::TaskCookAsset)
The HoudiniSchedulerThread then spins in a wait loop calling FHoudiniApi::GetStatus periodically to check when the cook is completed. (See: Bottom of FHoudiniEngineScheduler::TaskCookAsset).
The frequency of this polling is controlled by FHoudiniEngineScheduler::UpdateFrequency which is currently set to 100ms. This is causing there to be a random 0ms-100ms of unnecessary latency in the cook operation completing.
Possible Solutions
I am not sure what the best solution to this problem is.
The HAPI does allow you to stall the thread until the cook operation is complete. However this would break the other functionality in this function of periodically sending cook state notifications while in the wait loop.
Here are some possible solutions:
1. Increase the polling frequency
This is a half-measure solution
The GetStatus call appears to be fast but I am unsure if this causes any extra overhead inside the HAPI implementation.
2. Stall the HoudiniSchedulerThread and move the cook state update loop to a different thread.
It isn't clear what the thread safety is of the HAPI functions so not sure if this is safe.
3. Use a second worker thread that stalls and signals the cook complete signal back to HoudiniSchedulerThread using an FEventRef.
It isn't clear what the thread safety is of the HAPI functions so not sure if this is safe.
This is likely just a more complicated version of option 2.
4. Stall the HoudiniSchedulerThread only if the "Display Slate Cooking Notifications" option is turned off.
This assumes the cook state updates are only used to drive the notification UI which I am not sure of.
The notification UI is on by default, so this solution wouldn't help people with default settings.
4. Expose a wait with timeout primitive in the HAPI.
Problem
There is a large latency in how the cook completed state is synchronized between the Houdini application and the HoudiniSchedulerThread. This is causing an unnecessary random 0ms-100ms latency to get added to all cook operations.
This issue is similar to what I described in this PR: #309
A cook is performed on the HoudiniSchedulerThread by calling FHoudiniApi::CookNode. (See: FHoudiniEngineScheduler::TaskCookAsset)
The HoudiniSchedulerThread then spins in a wait loop calling FHoudiniApi::GetStatus periodically to check when the cook is completed. (See: Bottom of FHoudiniEngineScheduler::TaskCookAsset).
The frequency of this polling is controlled by FHoudiniEngineScheduler::UpdateFrequency which is currently set to 100ms. This is causing there to be a random 0ms-100ms of unnecessary latency in the cook operation completing.
Possible Solutions
I am not sure what the best solution to this problem is.
The HAPI does allow you to stall the thread until the cook operation is complete. However this would break the other functionality in this function of periodically sending cook state notifications while in the wait loop.
Here are some possible solutions:
1. Increase the polling frequency
2. Stall the HoudiniSchedulerThread and move the cook state update loop to a different thread.
3. Use a second worker thread that stalls and signals the cook complete signal back to HoudiniSchedulerThread using an FEventRef.
4. Stall the HoudiniSchedulerThread only if the "Display Slate Cooking Notifications" option is turned off.
4. Expose a wait with timeout primitive in the HAPI.
The text was updated successfully, but these errors were encountered: