// - Given two tasks T2 and T1, T2 will start after T1 starts if: // // * T2 is posted after T1; and // * T2 has equal or higher delay than T1; and // * T2 is non-nestable or T1 is nestable.
Looking at some task runner implementations it seems that MessageLoopTaskRunner and LibDispatchTaskRunner behave like I described above. Some of the test task runners like OrderedSimpleTaskRunner do not behave this way.
Let me know if there's something that I'm missing. Thanks!
- Sunny
I'm under the impression that T2 should run first always in that scenario.
--
--
Chromium Developers mailing list: chromi...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-dev...@chromium.org.
Which one runs first is undefined in this scenario.
The moment T1 is posted, the posting thread could be de-scheduled and T1 could be processed by a worker thread before T2 is even posted (this is less and less likely the bigger T1's delay but is never impossible). Even if the posting thread and underlying thread of the SequencedTaskRunner are the same, the delay could have passed by the time a task is dequeued).
Of course T2 could also run first per its smaller delay if posted and processed in time.
The only difference between SequencedTaskRunner and TaskRunner in this scenario is that both tasks are guaranteed to run in sequence (i.e. not in parallel).
Hope this makes sense, happy to answer follow-up questions.
Gab