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
When TaskScheduler has all execution slots filled up with low priority tasks and a high-priority task is scheduled, we should cancel and reschedule the newest low-priority task (newest because it has probably made the least progress that we would cancel).
rdar://127474310
The text was updated successfully, but these errors were encountered:
Decided not to do this because: Priority elevation of currently executing tasks is done asynchronously by polling in withTaskPriorityChangedHandler. We could thus reasonably get into the following scenario: All execution slots in the AsyncQueue are filled up with low-priority tasks. We now await all of them from a high-priority task (eg. because we want to ensure that the index is up-to-date). At the same time, we schedule a new high-priority task. If we implemented this, then we would cancel and reschedule one of the low-priority tasks only because its priority elevation hasn’t been propagated by priority polling. And that would be sub-optimal because it duplicates work. I think it’s better to just let the low-priority tasks finish.
When
TaskScheduler
has all execution slots filled up with low priority tasks and a high-priority task is scheduled, we should cancel and reschedule the newest low-priority task (newest because it has probably made the least progress that we would cancel).rdar://127474310
The text was updated successfully, but these errors were encountered: