vpp_main线程通过在文件vppsrcvlibmain.c中包含#include <vppinfra/tw_timer_1t_3w_1024sl_ov.h>指定了使用1t_3w_1024sl_ov类型时间轮构建定时器。
数据结构
- vlib_node_main_t
/* 线程与定时器相关成员 */
typedef struct
{
......
/* Timing wheel for scheduling time-based node dispatch. */
/* 基于时间的调度策略,依赖时间轮构建,使用的是1t_3w_1024sl_ov类型时间轮 */
void *timing_wheel;
/* vpp_main线程注册的定时器的私有数据保存向量,索引来自data_from_advancing_timing_wheel */
vlib_signal_timed_event_data_t *signal_timed_event_data_pool;
/* Opaque data vector added via timing_wheel_advance. */
/* 已经发生的定时事件的用户句柄保存内存 */
u32 *data_from_advancing_timing_wheel;
/* CPU time of next process to be ready on timing wheel. */
f64 time_next_process_ready;/* 该值目前没有使用,根据意思是最近一个可能超时的时间 */
......
} vlib_node_main_t;
- vlib_signal_timed_event_data_t
/* 定时