/*** Copyright (C) 2022 J Reece Wilson (a/k/a "Reece"). All rights reserved. File: LoopQueue.Linux.cpp Date: 2022-4-5 Author: Reece ***/ #include #include "Loop.NT.hpp" #include "ILoopSourceEx.hpp" #include "LoopQueue.Linux.hpp" namespace Aurora::Loop { // On Linux, Loop Queues are glorified eventfd to epoll adapters. // Requeuing the cached fd array per frame on the TLS io_submit object // would be more costly than maintaining an epoll for all fds tracked // by the loop queue. // We can delegate the wait functions to an NT overlapped like shim // where all eventfds are one epoll handle // The TLS worker would get awoken by any changes in the epoll queue // or if the io submit object should preemptively abort // The TLS worker would remain resposible for scheduling thread local // network and file transactions independent from the loop queues // As such, loop queues continue to be defined as a mechanism to merely // wait, not dispatch/manage work // Delegating mutex reads to a single io_submit would be a linux-specific // kevent-non-reusable ThreadWorkerQueueShim hack // ...it wouldn't make sense create another loop queue per thread concept // outside of the async subsystem (not counting TLS overlapped io) LoopQueue::LoopQueue() { } LoopQueue::~LoopQueue() { } bool LoopQueue::SourceAdd(const AuSPtr &source) { return {}; } bool LoopQueue::SourceAddWithTimeout(const AuSPtr &source, AuUInt32 ms) { return {}; } bool LoopQueue::SourceRemove(const AuSPtr &source) { return {}; } AuUInt32 LoopQueue::GetSourceCount() { return {}; } bool LoopQueue::AddCallback(const AuSPtr &source, const AuSPtr &subscriber) { return {}; } bool LoopQueue::AddCallbackEx(const AuSPtr &source, const AuSPtr &subscriber) { return {}; } bool LoopQueue::AddCallback(const AuSPtr &subscriber) { return {}; } void LoopQueue::ChugPathConfigure(AuUInt32 sectionTickTime, AuSInt sectionDequeCount) { } void LoopQueue::ChugHint(bool value) { } bool LoopQueue::Commit() { return true; } bool LoopQueue::IsSignaled() { return {}; } bool LoopQueue::WaitAll(AuUInt32 timeout) { return {}; } AuUInt32 LoopQueue::WaitAny(AuUInt32 timeout) { return {}; } AuList> LoopQueue::WaitAnyEx(AuUInt32 timeout) { return {}; } }