|
DelegateMQ
|
Standard C++ implementation of the DelegateMQ IThread interface. More...
#include "delegate/IThread.h"#include "./predef/util/Timer.h"#include "ThreadMsg.h"#include <thread>#include <queue>#include <atomic>#include <condition_variable>#include <future>#include <optional>Go to the source code of this file.
Classes | |
| struct | ThreadMsgComparator |
| class | Thread |
| Cross-platform thread for any system supporting C++11 std::thread (e.g. Windows, Linux). More... | |
Standard C++ implementation of the DelegateMQ IThread interface.
This class provides a cross-platform implementation of the IThread interface using standard C++11 primitives (std::thread, std::mutex, std::condition_variable). It creates a dedicated worker thread with an event loop capable of processing asynchronous delegates and system messages.
Key Features:
std::priority_queue to ensure high-priority delegate messages (e.g., system signals) are processed before lower-priority ones.maxQueueSize. If the queue is full, DispatchDelegate() blocks the caller until space is available, preventing memory exhaustion.std::promise and std::future to ensure the thread is fully initialized and running before CreateThread() returns.