Skip to content

[IO] add FutureSelector to multiplex waiting on multiple Futures

Florian Fischer requested to merge aj46ezos/emper:select into master

A FutureSelector is internally implemented as a Sempahore and a vector of monitored Futures. All Futures monitored by the selector know the selector and signal its semaphore on completion. When the FutureSelector's Semaphore is released the select unblocks and searches for the first ready Future in its list.

NOTE: The FutureSelector is except its Semaphore not thread-safe and must not be used in parallel. This means no Futures can be retrieved from or passed to other Fibers which would possibly result in parallel modification of the selector during Future destruction.

Edited by Florian Fischer

Merge request reports