Welcome! Log In Create A New Profile

Advanced

Re: How can the nginx detect the stale event using 'instance'?

Maxim Dounin
February 21, 2012 08:30AM
Hello!

On Tue, Feb 21, 2012 at 06:51:19PM +0900, 김수영 wrote:

> These days, I am studying the nginx source code..
>
> I think this code is very beautiful, and fully modulized.. BUT so it is difficult to follow the code.-_-;
>
> BTW, In struct ngx_event_s, there is ‘unsigned instance:1;’..
>
> I can’t understand how can the nginx detect the stale events using it.-_-;
>
> Could you please explain the detection mechanism or give me a hint?

The "instance" bit is passed in a event user data to the kernel
and when the kernel returns the event it's checked against one
recorded in the event structure. If there is no match - this
means the event reported by the kernel is stale (i.e. we've
already closed the descriptor in the very same event loop
iteration).

See e.g. src/event/modules/ngx_kqueue_module.c for details, in
particular ngx_kqueue_set_event() and ngx_kqueue_process_events().

Maxim Dounin

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

How can the nginx detect the stale event using 'instance'?

김수영 1265 February 21, 2012 04:52AM

Re: How can the nginx detect the stale event using 'instance'?

Maxim Dounin 469 February 21, 2012 08:30AM

RE: How can the nginx detect the stale event using 'instance'?

김수영 548 February 21, 2012 07:00PM

Re: How can the nginx detect the stale event using 'instance'?

Maxim Dounin 999 February 22, 2012 09:14AM



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

Online Users

Guests: 173
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready