Reworked missed work avoidance mechanism
When threads execute get_task or steal_task they can omit unsuitable tasks (different isolation or affinity). The omitted tasks are virtually extracted from task pool, that makes them temporary invisible for other threads. It might lead to situation when another thread marks the arena EMPTY (as a result of is_out_of_work()), while these tasks are still in the arena. If tasks were omitted we need to notify the arena like new work was added (calling advertise_new_work()).
The proposed idea is that omit tasks in such way that other threads can not observe it. It will prevent unnecessary arena state transition and premature threads leaving.
Therefore, the patch introduce shadow tail and head which move after real task extracted(do not participate in tasks omitting mechanism).
Signed-off-by: pavelkumbrasev [email protected]
@aleksei-fedotov @anton-potapov @alexey-katranov, could you please review this patch?
@aleksei-fedotov @anton-potapov @alexey-katranov, could you please review this patch?
Yep. Working on it!