Skip to content
Snippets Groups Projects
  1. Jul 29, 2021
  2. Jul 07, 2021
  3. Jul 06, 2021
  4. May 17, 2021
  5. May 04, 2021
  6. Apr 13, 2021
  7. Apr 01, 2021
  8. Mar 24, 2021
  9. Mar 23, 2021
    • Florian Fischer's avatar
      [Debug] s/WDBG/DBG and always terminate a log messager with a new line · 28028fac
      Florian Fischer authored
      Rename the macro used to build up the debug message, to better reflect
      its generality.
      It can be used anywhere to build a string with C++ stream formatting.
      std::string s = EMPER_BUILD_STR("foo = " << 1 " , bar = " << bar(42));
      
      Since WDBG was the only log macro without a terminating newline, which
      was in fact broken according to flow, we can remove it and the new line
      handling code in the LOG macro.
      28028fac
  10. Mar 18, 2021
    • Florian Fischer's avatar
      [IoContext] invalidate unsubmitted sqes · 03727b29
      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.
      03727b29
    • Florian Fischer's avatar
      [IO] mark IO functions returning futures as nodiscard · 79f6eb9f
      Florian Fischer authored
      Fix compilation error in LinkFutureTest where clsoe was used instead
      of closeAndWait.
      79f6eb9f
  11. Mar 16, 2021
  12. Mar 13, 2021
  13. Mar 03, 2021
  14. Feb 26, 2021
    • Florian Fischer's avatar
      [meson] better propagate dependencies · 2d0b5f6b
      Florian Fischer authored
      The emper header LockedUnboundedQueue.hpp could depend on different libraries
      according to the implementation.
      
      To link those dependencies with everything including LockedUnboundedQueue.hpp
      we propagate all emper_dependencies through emper_dep.
      
      And using emper_dep as a dependency seems anyway better than essentially
      writing down emper_dep manually each time.
      
      emper_dep essentially is:
      (link_with:emper, include_directories: emper_all_include)
      2d0b5f6b
  15. Feb 22, 2021
  16. Feb 20, 2021
  17. Feb 19, 2021
  18. Feb 05, 2021
    • Florian Fischer's avatar
      [IO] add callback support · 827b79ae
      Florian Fischer authored
      Futures can have a registered Callback of type
      std::function<void(const uint32_t&)> which gets called in a new
      Fiber with the result of the IO Request.
      Note the first completion will cause the execution of a callback and
      partial completion support must be implemented manually in the callback.
      
      Callbacks are stored in a heap allocated std::function on registration
      and are freed by the new Fiber after the callback returned;
      
      The Future with a registered Callback is not referenced in any way in
      the IO subsystem and therefore can be dropped after being submitted.
      This also means that a Future with a registered callback will not be
      signaled by the IO subsystem on completion.
      If signaling is desired one must implement it manually in the registered
      callback.
      827b79ae
    • Florian Fischer's avatar
      [test] use gtest meson wrap if gtest is not found · 3790a034
      Florian Fischer authored
      The gtest wrap can be updated with the meson wrap command
      3790a034
    • Florian Schmaus's avatar
  19. Feb 03, 2021
  20. Feb 02, 2021
  21. Jan 29, 2021
  22. Jan 28, 2021
    • Florian Fischer's avatar
      [test] fix occasional failures of SimpleDiskAndNetworkTest · 54dd7ffa
      Florian Fischer authored
      Concurrently connecting and creating the server socket is racy.
      Now the server socket is created before any Fiber is started
      removing this race.
      Note: The same race is theoretically in SimpleNetworkTest and
      ConcurrenctEchoTest too but I haven't observed the failure yet
      54dd7ffa
  23. Jan 26, 2021
    • Florian Schmaus's avatar
    • Florian Fischer's avatar
      [IO] introduce emper::io a IO subsystem using io_uring · 460c2f05
      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.
      460c2f05
Loading