comparison src/event/ngx_event.h @ 6635:6acaa638fa07

Events: support for EPOLLEXCLUSIVE. This flag appeared in Linux 4.5 and is useful for avoiding thundering herd problem. The current Linux kernel implementation walks the list of exclusive waiters, and queues an event to each epfd, until it finds the first waiter that has threads blocked on it via epoll_wait().
author Valentin Bartenev <vbart@nginx.com>
date Fri, 15 Jul 2016 15:18:57 +0300
parents bcd442b585f0
children 56fc55e32f23
comparison
equal deleted inserted replaced
6634:18f6120e3b7a 6635:6acaa638fa07
365 #define NGX_ONESHOT_EVENT 0x70000000 365 #define NGX_ONESHOT_EVENT 0x70000000
366 #if 0 366 #if 0
367 #define NGX_ONESHOT_EVENT EPOLLONESHOT 367 #define NGX_ONESHOT_EVENT EPOLLONESHOT
368 #endif 368 #endif
369 369
370 #if (NGX_HAVE_EPOLLEXCLUSIVE)
371 #define NGX_EXCLUSIVE_EVENT EPOLLEXCLUSIVE
372 #endif
370 373
371 #elif (NGX_HAVE_POLL) 374 #elif (NGX_HAVE_POLL)
372 375
373 #define NGX_READ_EVENT POLLIN 376 #define NGX_READ_EVENT POLLIN
374 #define NGX_WRITE_EVENT POLLOUT 377 #define NGX_WRITE_EVENT POLLOUT
390 393
391 #if (NGX_HAVE_IOCP) 394 #if (NGX_HAVE_IOCP)
392 #define NGX_IOCP_ACCEPT 0 395 #define NGX_IOCP_ACCEPT 0
393 #define NGX_IOCP_IO 1 396 #define NGX_IOCP_IO 1
394 #define NGX_IOCP_CONNECT 2 397 #define NGX_IOCP_CONNECT 2
398 #endif
399
400
401 #if (NGX_TEST_BUILD_EPOLL)
402 #define NGX_EXCLUSIVE_EVENT 0
395 #endif 403 #endif
396 404
397 405
398 #ifndef NGX_CLEAR_EVENT 406 #ifndef NGX_CLEAR_EVENT
399 #define NGX_CLEAR_EVENT 0 /* dummy declaration */ 407 #define NGX_CLEAR_EVENT 0 /* dummy declaration */