timer_list.h
Include dependency graph for timer_list.h:
This graph shows which files directly or indirectly include timer_list.h:
Typedefs
- void() timer_list_callback_t (struct TimerListItem *)
Functions
-
static inline void timer_list_insert(struct TimerList *tw, struct TimerListItem *item)
-
static inline void timer_list_remove(struct TimerList *tw, struct TimerListItem *item)
-
static inline void timer_list_item_init(struct TimerListItem *it, uint64_t expiry)
-
void timer_list_next(struct TimerList *tw, uint64_t now, timer_list_callback_t cb)
process the timer wheel, calling cb for every item that should be fired (for which
expiry_time
<=now
).The current algorithm is very basic. Under heavy load, two processes scheduled for different timers might be triggered (same seems to be true with BEAM). The only optimization is the next time is saved so the function doesn’t run every timer on every call.
- Parameters:
tw – the timer wheel
now – the current monotonic date
cb – the callback
-
struct TimerList
- #include <timer_list.h>
Collaboration diagram for TimerList:
-
struct TimerListItem
- #include <timer_list.h>
Collaboration diagram for TimerListItem: