Skip to content
Snippets Groups Projects
Commit 3f87157a authored by Florian Fischer's avatar Florian Fischer
Browse files

Prepare the IO subsystem for emper's future

All code related to the gloablIo is moved from IoContext to the GlobalIoContext
child class.

Remember the runtime in each IoContext which created the IoContext.
This allows the IoContexts to be independent from a global runtime reference.
Because of this change a IoContext (global or worker) musst be retrieved
from the a runtime object using Runtime::getIo()

The only point in the IO subsystem where we depend on Runtime::getRuntime()
is when resubmitting a PartialCompletableFuture.
To be sure we use the correct Runtime object Runtime::getRuntime() should
return the runtime which started the thread (worker or globalCompleter).
This could be achieved by remembering the runtime in a thread_local variable
for example.

The global completer thread is now tied to a GlobalIoContext object
and can be terminated using the GlobalIoContext's eventfd
through GlobalIoContext::initiateTermination() and GlobalIoContext::waitUntilFinished()
parent 0e67670b
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment