Make decision how many workers to notify in Runtime
The decision how many workers should be notified on new work should be made in the runtime. This is the whole reason why WorkerWakeupStrategies provide notify{One,Many,All} functions. This change also simplifies the logic used in SemaphoreWorkerSleepStrategy. The old simply copy-pasted semaphore based implementation could then be split up into much smaller and simpler pieces. SemaphoreWorkerSleepStrategy::notify{All, Many} is could actually be faster because it can now use the semaphores notify_many function instead of calling notifyInternal multiple times.
parent
3ab70f90
No related branches found
No related tags found
Showing
- emper/Runtime.hpp 8 additions, 1 deletionemper/Runtime.hpp
- emper/sleep_strategy/AbstractWorkerSleepStrategy.hpp 1 addition, 0 deletionsemper/sleep_strategy/AbstractWorkerSleepStrategy.hpp
- emper/sleep_strategy/SemaphoreWorkerSleepStrategy.hpp 17 additions, 37 deletionsemper/sleep_strategy/SemaphoreWorkerSleepStrategy.hpp
Loading
Please register or sign in to comment