emper issueshttps://gitlab.cs.fau.de/aj46ezos/emper/-/issues2022-08-08T17:41:06Zhttps://gitlab.cs.fau.de/aj46ezos/emper/-/issues/3Distributed Notification Scheme2022-08-08T17:41:06ZFlorian FischerDistributed Notification SchemeSome random thoughts I had during my MA.
This issue is just a place to dump my idea to delete the local file on my machine
# Distributed new work notification scheme
## Goals
* No global state
* Hints where new work can be found
* ...Some random thoughts I had during my MA.
This issue is just a place to dump my idea to delete the local file on my machine
# Distributed new work notification scheme
## Goals
* No global state
* Hints where new work can be found
* fibers
* IO completions
* Workers wakeup when IO is completed in their io_uring
## Idea
* Use one/multiple waker threads only running when at least one thread is sleaping
-> prevents over provisioning
* Each worker has a blockable IO-object
* Each worker has a hint variable
## Waker algorithm
global workers
sleepers := {}
hints := {}
loop
for worker in workers
if worker in hints
continue
if worker in sleepers
if hint in hints
remove hint from hints
reset hint
wake sleeper with hint
remove sleeper from sleepers
continue
if worker is sleeping
add worker to sleepers
continue
if worker has hint
reset worker hint
if sleepers
wake sleeper with hint
else
add worker to hints
(possible backoff)
if everybody is sleeping
sleep
## On new work
write hint
## Worker sleep
mark sleeping
prepare read from IO object
submit and wait for completions in io_uring
if waker sleeping
wake waker
## Problem
How to guaranty that the waker is only running if at least one worker is sleeping
Could futex2 be the solution sleeping on each possible hint variable??