- Mar 08, 2021
-
-
Florian Fischer authored
Since 8f38dbed the globalCompleter does always reap and schedule in batches through IoContest::reapAndSchedule<CallerEnvironment::ANYWHERE> -> Runtime::scheduleFromAnywhere(Input it begin, InputIt end) -> AnywhereQueue::insert(Input it begin, InputIt end)
-
- Mar 01, 2021
-
-
Florian Fischer authored
-
- Feb 26, 2021
-
-
Florian Fischer authored
Available implementations configurations through the meson option 'locked_unbounded_queue_implementation' are: mutex - our current LockedUnboundedQueue implementation using std::mutex rwlock - An implementation with pthread_rwlock. The implementations tries to upgrade its rdlock and drops and acquires a wrlock on failure shared_mutex - An implementation using std::shared_mutex. dequeue() acquires a shared lock at first, drops it and acquires a unique lock boost_shared_mutex - An implementation using boost::shared_mutex. dequeue() acquires an upgradable lock and upgrade it to a unique lock if necessary
-
Florian Fischer authored
This change introduces new scheduleFromAnywhere methods which take a range of Fibers to schedule. Blockable gets a new method returning the fiber used to start the unblocked context, which is used by Future/PartialCompletableFuture to provide a way of completion and returning the continuation Fiber to the caller so they may schedule the continuation how they want. If the meson option io_batch_anywhere_completions is set the global completer will collect all callback and continuation fibers before scheduling them at once when it is done reaping the completions. The idea is that taking the AnywhereQueue write lock and calling onNewWork must only be done once. TODO: investigate if onNewWork should be extended by an amountOfWork argument which determines how many worker can be awoken and have work to do. This should be trivially since our WorkerWakeupSemaphore implementations already support notify_many(), which may be implemented in terms of notify_all though.
-
- Feb 23, 2021
-
-
Florian Fischer authored
LockedSemaphore is the already existening Semaphore using a mutex and a condition variable. PosixMutex is a thin wrapper around a POSIX semaphore. SpuriousFutexSemaphore is a atomic/futex based implementation prune to spurious wakeups which is fine for the worker wakeup usecase.
-
- Feb 10, 2021
-
-
Florian Fischer authored
-
- 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.
-
Florian Fischer authored
This feature must be activated using the blocked_context_set meson option.
-
- Jan 22, 2021
-
-
Florian Schmaus authored
This introduces AbstractWorkStealingScheduler which holds the common work-stealing scheduling strategy.
-
- Jan 13, 2021
-
-
Florian Schmaus authored
This also changes emper_log so that a std::ostringstream is used to assemble the log message.
-
- Jan 11, 2021
-
-
Florian Schmaus authored
Initiailze the WORKER_WAKEUP_STRATEGY via the contents of the EMPER_WORKER_WAKEUP_STRATEGY macro. This makes it easier to add additional strategies later on.
-
- Jan 05, 2021
-
-
Florian Fischer authored
-
- Dec 17, 2020
-
-
Florian Schmaus authored
Co-authored-by:
Florian Fischer <florian.fl.fischer@fau.de>
-
- Nov 30, 2020
-
-
Florian Fischer authored
Compile-time: * A new meson option 'log_level' is introduced which has all the values from the Loglevel enum * The 'OFF' option defines EMPER_LOG_OFF which causes the LOG* macros to be empty and the Logger<>::log function to return immediately * The default 'automatic' option sets 'log_level' to 'Error' for release builds and to 'ALL' otherwise Runtime: * The global variable emper::log_level defined in Debug.hpp controls the logging output * It is initialized with the meson option 'log_level' but can be changed during runtime
-
Florian Fischer authored
-
Florian Fischer authored
Disable the userpace-rcu support by default. Our used userspace-rcu flavor memb is rather new and not available in liburcu version 0.10 available in debian buster. This change switches from using DCE and "if constexpr" to the C preprocessor so the library is only needed when the userspace-rcu support is actually enabled.
-
- Nov 19, 2020
-
-
Florian Fischer authored
-
- Nov 17, 2020
-
-
Florian Fischer authored
The default flavor is the preferred way to use the userspace library it uses the sys_membarrier syscall or falls back to using userspace membarriers. This adds the liburcu dependency which must be installed regardless the 'liburcu' meson option.
-
- Jul 31, 2020
-
-
Florian Schmaus authored
-