-
Florian Fischer authored
The throttle algorithm had the same problem like our sleep algorithms where notifications from anywhere may race with a worker going to sleep resulting in lost wakeups. In the sleep strategy we prevent those races by preventing sleep attempts when notifing from anywhere. The throttle algorithm also does now exactly this. A notifier from anywhere will now always set the WakeupStrategy state to notified. If the state was previously pending this new approach does not differ from the previous behavior and a sleeping worker will be notified. If the state was waking the waking worker skips its sleep if it observes the WakeupStrategy state as notified.
Florian Fischer authoredThe throttle algorithm had the same problem like our sleep algorithms where notifications from anywhere may race with a worker going to sleep resulting in lost wakeups. In the sleep strategy we prevent those races by preventing sleep attempts when notifing from anywhere. The throttle algorithm also does now exactly this. A notifier from anywhere will now always set the WakeupStrategy state to notified. If the state was previously pending this new approach does not differ from the previous behavior and a sleeping worker will be notified. If the state was waking the waking worker skips its sleep if it observes the WakeupStrategy state as notified.