Welcome! Log In Create A New Profile

Advanced

Re: Event Timers and RB trees

agentzh
January 03, 2010 09:20PM
On Sat, Jan 2, 2010 at 12:29 AM, test guy <testguy103@gmail.com> wrote:
>
> I have been looking through the nginx source code and cannot figure out how event timers are used (and their purpose). Can somebody shed some light on this for me please?
>

Timers are usually used to implement the timeout mechanism for
non-blocking I/O operations in nginx. But it is also used to implement
non-blocking sleep in the ngx_chunkin module. Logically, a timer is
usually associated with an ngx_event_t object, and at any one time,
only one timer is allowed for one ngx_event_t object.

Two functions are often used to handle timers, ngx_add_timer and ngx_del_timer.

> Also, I noticed a red/black tree is used somehow with event timers, and I also do not understand this.
>

It's used to store the timers themselves. It's the implementation
details already, I think ;)

Cheers,
-agentzh

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Event Timers and RB trees

test guy 3088 January 01, 2010 11:30AM

Re: Event Timers and RB trees

agentzh 1398 January 03, 2010 09:20PM

Re: Event Timers and RB trees

agentzh 948 January 03, 2010 09:20PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 66
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready