-
- Downloads
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()
Showing
- emper/Runtime.cpp 16 additions, 7 deletionsemper/Runtime.cpp
- emper/Runtime.hpp 6 additions, 11 deletionsemper/Runtime.hpp
- emper/io/Future.hpp 1 addition, 0 deletionsemper/io/Future.hpp
- emper/io/GlobalIoContext.cpp 174 additions, 0 deletionsemper/io/GlobalIoContext.cpp
- emper/io/GlobalIoContext.hpp 43 additions, 0 deletionsemper/io/GlobalIoContext.hpp
- emper/io/IoContext.cpp 19 additions, 128 deletionsemper/io/IoContext.cpp
- emper/io/IoContext.hpp 30 additions, 35 deletionsemper/io/IoContext.hpp
- emper/io/meson.build 1 addition, 0 deletionsemper/io/meson.build
Loading
Please register or sign in to comment