#ifndef _NGINX_H_
#define _NGINX_H_
#include <iostream>
#define NGX_QUEUE_T typedef
#define NGX_T typedef
#define LIST_T typedef
typedef int NGX_ELEM_TYPE;
//双向循环链表
LIST_T struct _List_t {
_List_t *prev;
_List_t *next;
}List_t, *List_t_p;
// 在ngx中 是对头 出队 队尾入队
NGX_QUEUE_T struct _Ngx_queue_t {
NGX_ELEM_TYPE lenth;
_List_t *rear;
_List_t *front;
}*Ngx_queue_p,Ngx_queue_node;
NGX_T struct _Ngx_t {
//编号
NGX_ELEM_TYPE fd;
//调用次数 //用顺序表进行记录
NGX_ELEM_TYPE num;
//类似于linux 内核的共享双向链表
_List_t queue_node;
}Ngx_node, *Ngx_node_p;
//宏函数定义区 对双向循环链表进行初始化等操作
//链表的初始化
#define Ngx_queue_init(L) \
(L)->prev = L; \
(L)->next = L
#define Is_Ngx_queue_empty(L) \
(L == (L)->prev) //因为从队首入队
//link是原来的队列 , node是要插入的结点队列结点
#define Ngx_queue_insert_head(li
Nginx反向代理服务器高速缓存数据结构的部分实现
最新推荐文章于 2020-06-29 21:58:15 发布
本文深入探讨了Nginx作为反向代理服务器如何利用高速缓存提高性能,重点解析了其数据结构在缓存管理中的关键作用。
摘要由CSDN通过智能技术生成