Defines | Functions

modules/tm/timer.h File Reference

TM :: timer support. More...

#include "defs.h"
#include "../../compiler_opt.h"
#include "lock.h"
#include "../../timer.h"
#include "h_table.h"
#include "config.h"
Include dependency graph for modules/tm/timer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

Functions


Detailed Description

TM timer support. It has been designed for high performance using some techniques of which timer users need to be aware.

The following example shows it:

PROCESS1 TIMER PROCESS

So be careful when writing the timer handlers. Currently defined timers don't hurt if they hit delayed, I hope at least. Retransmission timer may results in a useless retransmission -- not too bad. FR timer not too bad either as timer processing uses a REPLY mutex making it safe to other processing affecting transaction state. Wait timer not bad either -- processes putting a transaction on wait don't do anything with it anymore.

Example when it does not hurt:

PROCESS1 TIMER PROCESS

The rule of thumb is don't touch data you put under a timer. Create data, put them under a timer, and let them live until they are safely destroyed from wait/delete timer. The only safe place to manipulate the data is from timer process in which delayed timers cannot hit (all timers are processed sequentially).

A "bad example" -- rewriting content of retransmission buffer in an unprotected way is bad because a delayed retransmission timer might hit. Thats why our reply retransmission procedure is enclosed in a REPLY_LOCK.

Definition in file modules/tm/timer.h.


Function Documentation

int timer_fixup ( void *  handle,
str gname,
str name,
void **  val 
)

Fixup function for the timer values, (called by the configuration framework)

Parameters:
handle not used
gname not used
name not used
val fixed timer value
Returns:
0 on success, -1 on error

Definition at line 255 of file modules/tm/timer.c.

References IF_IS_TIMER_NAME, and MS_TO_TICKS.

int timer_fixup_ms ( void *  handle,
str gname,
str name,
void **  val 
)

(called by the configuration framework) It checks if the value fits in the tm structures

Definition at line 282 of file modules/tm/timer.c.

References IF_IS_TIMER_NAME.