-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minheap #53
Minheap #53
Conversation
@@ -135,6 +143,13 @@ static char *ngx_event_debug_connection(ngx_conf_t *cf, ngx_command_t *cmd, | |||
0, | |||
NULL }, | |||
|
|||
{ ngx_string("timer"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
timers
@@ -26,7 +26,6 @@ | |||
typedef void (*ngx_event_handler_pt)(ngx_event_t *ev); | |||
typedef void (*ngx_connection_handler_pt)(ngx_connection_t *c); | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
restore this line
src/event/ngx_event_timer.h: In function ‘ngx_event_add_timer_minheap’: 打开--with-debug选项编译出错了 |
coredump, 没有配置timer选项 Program terminated with signal 11, Segmentation fault. |
Should we test this pull request more sufficiently? |
typedef void (*ngx_event_expire_timers_pt)(void); | ||
typedef void (*ngx_event_del_timer_pt)(ngx_event_t *ev); | ||
typedef void (*ngx_event_add_timer_pt)(ngx_event_t *ev, ngx_msec_t timer); | ||
typedef ngx_int_t (*ngx_event_timer_is_empty_pt)(void); | ||
#endif /* _NGX_CORE_H_INCLUDED_ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should add a new line above
这个minheap 有没有可能出现时间溢出的问题? |
ngx_rbtree_node_t rbtree; | ||
ngx_minheap_node_t minheap; | ||
} ngx_event_timer_node_t; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
加入公共的 key 成员处理上是否会好一些
@@ -27,6 +27,7 @@ CORE_DEPS="src/core/nginx.h \ | |||
src/core/ngx_md5.h \ | |||
src/core/ngx_sha1.h \ | |||
src/core/ngx_rbtree.h \ | |||
src/core/ngx_minheap.h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这对吗?
support minheap and minheap4 for nginx event timer
add a instruction(named timer) in events block
events {
timer rbtree | minheap | minheap4;
}
default:rbtree