SW Task Event Loop Framework v1.0.0
High-performance C++ asynchronous event loop framework with timer management and promise-based programming
Loading...
Searching...
No Matches
TimerManager.h File Reference

High-performance timer management using Linux timerfd+epoll or sigev_thread. More...

#include "Timer.h"
#include <sys/timerfd.h>
#include <sys/epoll.h>
#include <unistd.h>
#include <signal.h>
#include <time.h>
#include <functional>
#include <unordered_map>
#include <thread>
#include <atomic>
#include <memory>
#include <mutex>
#include <stdexcept>
Include dependency graph for TimerManager.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  swt::TimerManager
 High-performance timer management with configurable backend. More...
 
struct  swt::TimerManager::TimerInfo
 Internal timer information structure. More...
 

Namespaces

namespace  swt
 Software Timer namespace containing all timer-related classes.
 

Macros

#define TIMER_USE_TIMERFD_EPOLL
 Enable timerfd + epoll backend (Linux-specific, high performance)
 

Detailed Description

High-performance timer management using Linux timerfd+epoll or sigev_thread.

Author
Tran Anh Tai
Date
9/2025
Version
1.0.0

This file provides a high-performance timer management system with two configurable backends:

  • timerfd + epoll (Linux-specific, high performance)
  • timer_create + sigev_thread (POSIX-compliant, portable)

The backend is selected at compile time via preprocessor macros.

Definition in file TimerManager.h.