- Jul 06, 2021
-
-
Florian Fischer authored
Until kernel commit cf10960426515 io_uring submitted sqe until it encountered an invalid one. Now io_uring will catch the error on subimssion and will cancel all sqe's contained in the link prior to the invalid one.
-
- May 17, 2021
-
-
Florian Fischer authored
-
- Apr 01, 2021
-
-
Florian Fischer authored
Move io and lib related tests into io/ and lib/. Our test dictionaries not must have a 'source' key with an array created with files(). This ensures we use always correct paths regardless of the actual directory we are currently in. Until https://github.com/mesonbuild/meson/issues/8608 is not solved we have to separately specify the tests name in a 'name' key.
-
- Mar 24, 2021
-
-
Florian Schmaus authored
The test fixture will automatically assume that the test was successful if emperTest() returns.
-
- Mar 18, 2021
-
-
Florian Fischer authored
io_uring_submit does some inline error checking and consumes less cqes than prepared if an error is detected. Currently we just cancel the Futures, whose prepared sqes were not submitted. But this leaves already prepared sqes for those futures in the SQ of the io_uring which will be submitted the next time io_uring_submit is called. This results in a violation of the chain guaranty, that dependent operations are only executed if all dependencies were successful. Additionally this leads to double completions or memory corruption because the io_uring will produce cqes for already completed Futures. To prevent this from happening we track all sqes we prepared to invalidate and resubmit those which were not submitted because of a short submit. We invalidate sqes by preparing them as NOP instructions and set their user data to NULL. I took this approach instead of rewinding the ring or somethings like similar because it seemed safer for me not fiddle with io_uring internals and just be less efficient. Enable previously failing LinkFutureTest test cases.
-
Florian Fischer authored
Fix compilation error in LinkFutureTest where clsoe was used instead of closeAndWait.
-
- Mar 16, 2021
-
-
Florian Fischer authored
Document the encountered failures in code comments.
-
Florian Fischer authored
This test resembles our EchoClient implementation using linked futures.
-
- Jan 26, 2021
-
-
Florian Fischer authored
Empers IO design is based on a proactor pattern where each worker can issue IO requests through its exclusive IoContext object which wraps an io_uring instance. IO completions are reaped at 4 places: 1. After a submit to collect inline completions 2. Before dispatching a new Fiber 3. When no new IO can be submitted because the completion queue is full 4. And by a global completer thread which gets notified about completions on worker IoContexts through registered eventfds All IO requests are modeled as Future objects which can be either instantiated and submitted manually, retrieved by POSIX-like non-blocking or implicitly used by posix-like blocking functions. User facing API is exported in the following headers: * emper/io.hpp (POSIX-like) * emper.h (POSIX-like) * emper/io/Future.hpp Catching short write/reads/sends and resubmitting the request without unblocking the Fiber is supported. Using AlarmFuture objects Fibers have a emper-native way to sleep for a given time. IO request timeouts with TimeoutWrapper class. Request Cancellation is supported with Future::cancel() or the CancelWrapper() Future class. A proactor design demands that buffers are committed to the kernel as long as the request is active. To guaranty memory safety Futures get canceled in their Destructor which will only return after the committed memory is free to use. Linking Futures to chains is supported using the Future::SetDependency() method. Future are submitted when their last Future gets submitted. A linked Request will start if the previous has finished. Error or partial completions will cancel the not started tail of a chain. TODO: Handle possible situations where the CQ of the global completer is full and no more sqe can be submitted to the SQ.
-