Skip to content

Suspend all dispatching of low-priority work while high priority work is running? #138

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

You must be logged in to vote

One way to do this would be to spawn an IPinnedTask per thread which calls WaitforTask( nullptr, enki::TASK_PRIORITY_HIGH ) or with the high priority task you want to run as the task to wait on. This will stop any lower priority tasks running whilst allowing other tasks to run.

You may also need to signal the low priority tasks to quit if they are running a loop holding the lock.

I am contemplating adding more easily customizable scheduling to enkiTS which would make this sort of thing easier.

Do let me know if the above isn't clear enough and I'll write a short code sample.

FYI another more complicated solution is to use dependencies rather than locks. I'm investigating explicit resource…

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