--
You received this message because you are subscribed to the Google Groups "scheduler-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scheduler-de...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CAH6dBrHUa2JWNw9bBpXmTZq3AH-FmHN53mTz-07gynomd3Wvdw%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CAH6dBrFv%3DN4a_u9NihOvCLiNmoJ%2Bj1ZiYBms1cp9k%3DAREOpS%2BA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/scheduler-dev/CAJTZ7LJ2yvaxF%2BFebgjn9xHnr_R%2BnTk1sSXyDS8di%3Dhj3cFHUw%40mail.gmail.com.
Anecdotal evidence: I often hear this question from people new to the chromium codebase.There are several ways to post a task, and the concurrency guarantees of doing so are not easily readable from all the variants in the code. Therefore it would be nice to clarify this in documentation. Would it be correct/enough to say that PostTask and the execution of the posted task are in the happens-before relationship with each other for all the ways to post a task?2c: I'm suggesting happens-before over happens-after on purpose: the latter is only very rarely used in standards, APIs, CS articles and other literature.
My worry with adding the doc to some PostTask's is that it may then yield the implicit question of whether the undocumented ones lack this property (while none can). I'm surprised that there's confusion though as I don't see how a task system could work without this guarantee.
Maybe we can document this globally in threading_and_tasks.md?
On Wed, Feb 15, 2023 at 10:15 PM Gabriel Charette <g...@chromium.org> wrote:My worry with adding the doc to some PostTask's is that it may then yield the implicit question of whether the undocumented ones lack this property (while none can). I'm surprised that there's confusion though as I don't see how a task system could work without this guarantee.Indeed it is hard to imagine a task posting system for Chrome without the guarantee. Though there still is a source for confusion because devs want to know exactly what their primitives do before relying on them. We should respect this willingness to build robust software stack on all levels and document subtle concurrency guarantees in common APIs such as this one, even if those facts can be inferred. There is still a lot to know about Chrome specifics to avoid the confusion: the memory hierarchies we support, the task granularity, the latency guarantees, etc. For someone who is only starting their journey in the codebase, this knowledge is not necessarily a given.Maybe we can document this globally in threading_and_tasks.md?Thanks! This looks like a good place to me. Here is my first draft for review: https://chromium-review.googlesource.com/c/chromium/src/+/4261928