Introduce waitfree workstealing
Waitfree work stealing is configured with the meson option 'waitfree_work_stealing'. The retry logic is intentionally left in the Queues and not lifted to the scheduler to reuse the load of an unsuccessful CAS. Consider the following pseudo code examples: steal() -> bool: steal() -> res load load loop: if empty return EMPTY if empty return EMPTY cas cas return cas ? STOLEN : LOST_RACE if not WAITFREE and not cas: goto loop outer(): return cas ? STOLEN : LOST_RACE loop: res = steal() outer(): if not WAITFREE and res == LOST_RACE: steal() goto loop In the right example the value loaded by a possible unsuccessful CAS can not be reused. And a loop of unsuccessful CAS' will result in double loads. The retries are configurable through a template variable maxRetries. * maxRetries < 0: indefinitely retries * maxRetries >= 0: maxRetries
Showing
- .gitlab-ci.yml 9 additions, 0 deletions.gitlab-ci.yml
- emper/Emper.hpp 8 additions, 0 deletionsemper/Emper.hpp
- emper/lib/adt/LockedQueue.hpp 5 additions, 3 deletionsemper/lib/adt/LockedQueue.hpp
- emper/lib/adt/WsClQueue.hpp 23 additions, 8 deletionsemper/lib/adt/WsClQueue.hpp
- emper/lib/adt/WsClV2Queue.hpp 22 additions, 13 deletionsemper/lib/adt/WsClV2Queue.hpp
- emper/strategies/AbstractWorkStealingScheduler.cpp 5 additions, 2 deletionsemper/strategies/AbstractWorkStealingScheduler.cpp
- meson.build 2 additions, 0 deletionsmeson.build
- meson_options.txt 6 additions, 0 deletionsmeson_options.txt
Loading
Please register or sign in to comment