|
SimGrid 3.7.1
Scalable simulation of distributed systems
|
Delayed and repetitive tasks. More...
Functions | |
| void | gras_timer_delay (double delay, void_f_void_t action) |
| Request action to be called once in delay seconds. | |
| void | gras_timer_repeat (double interval, void_f_void_t action) |
| Request action to be called every interval seconds. | |
| void | gras_timer_cancel_delay (double interval, void_f_void_t action) |
| Cancel a delayed task. | |
| void | gras_timer_cancel_repeat (double interval, void_f_void_t action) |
| Cancel a repetitive task. | |
| void | gras_timer_cancel_delay_all (void) |
| Cancel all delayed tasks. | |
| void | gras_timer_cancel_repeat_all (void) |
| Cancel all repetitive tasks. | |
| void | gras_timer_cancel_all (void) |
| Cancel all delayed and repetitive tasks. | |
Delayed and repetitive tasks.
This is how to have a specific function called only once after the specified amount of time or a function executed every 5 mn until it gets removed. In the UNIX world, this is comparable to at and cron.
Note that this is very soft timers: the execution of the processes won't get interrupted at all. This is on purpose: the GRAS programming model is distributed sequential, so that users don't have to deal with mutexes and such within a specific process.
Timers are served by the gras_handle() function: if there is an elapsed timer, the associated code gets executed before any incoming connexion are checked.
The section Some timer games constitutes a perfect example of these features.
| Back to the main Simgrid Documentation page |
The version of SimGrid documented here is v3.7.1. Documentation of other versions can be found in their respective archive files (directory doc/html). |
Generated by
|