-
- Downloads
[Runtime] use a POSIX semaphore to suspend/wakeup workers
To prevent deadlocks where all workers are going to sleep and new work arrives from without emper we always increment the wakeup semaphore unless we observe its value as > worker count. If the semaphore value is bigger than worker count it is guarantied that at least on worker will not block and will iterate a second time in its dispatchLoop observing the new work.
Showing
- emper/Dispatcher.cpp 1 addition, 1 deletionemper/Dispatcher.cpp
- emper/Runtime.cpp 8 additions, 3 deletionsemper/Runtime.cpp
- emper/Runtime.hpp 49 additions, 51 deletionsemper/Runtime.hpp
- emper/Scheduler.cpp 7 additions, 5 deletionsemper/Scheduler.cpp
- emper/Scheduler.hpp 3 additions, 8 deletionsemper/Scheduler.hpp
Loading
Please register or sign in to comment