Skip to content

Seeing jobs spawned by PhysicsSystem::Update execute after that function has returned #1523

Answered by jrouwe
miketuritzin asked this question in Q&A
Discussion options

You must be logged in to vote

The Job is considered 'complete' when the 'Execute' function has returned (or actually a few instructions before returning). JobSystemThreadPool however still needs to call Release to free the job before it can go to sleep. It is also possible that the main thread has stolen work in which case Execute will be called again on another thread. In this case the Job will do nothing because it is already in the 'done' state.

So yes, you can see that the threads are still doing some clean up work, but the actual work has been done when PhysicsSystem::Update completes.

If you see callstacks that actually call into PhysicsSystem::Job* after PhysicsSystem::Update finishes, then something is wrong a…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@miketuritzin
Comment options

Answer selected by miketuritzin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants