Functions

timer_funcs.h File Reference

SIP-router core :: Timer related functions (internal)Module: SIP-router core. More...

#include "timer.h"
Include dependency graph for timer_funcs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

hierarchical timing wheel with 3 levels

Most timeouts should go in the first "wheel" (h0) h0 will contain timers expiring from crt.

time up to crt. time + (1<<H0_BITS)/TICKS_HZ s and will use (1<<H0_BITS)*sizeof(struct timer_head) bytes of memory, so arrange it accordingly

Uses ~280K on a 64 bits system and ~140K on a 32 bit system; for TICKS_HZ=10 holds ~ 30 min in the first hash/wheel and ~233h in the first two. More perfomant arrangement: 16, 8, 8 (but eats 1 MB on a 64 bit system, and 512K on a 32 bit one). For TICKS_HZ=10 it holds almost 2h in the first hash/wheel and ~460h in the first two.

Functions


Detailed Description

Definition in file timer_funcs.h.


Function Documentation

static int _timer_dist_tl ( struct timer_ln *  tl,
ticks_t  delta 
) [inline, static]

tl->expire must be set previously, delta is the difference in ticks from current time to the timer desired expire (should be tl->expire-*tick) If you don't know delta, you probably want to call _timer_add instead.

Definition at line 115 of file timer_funcs.h.