summaryrefslogtreecommitdiff
path: root/memcached.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2021-07-29 17:31:08 -0700
committerdormando <dormando@rydia.net>2021-08-09 17:09:08 -0700
commitc25d0bd68ab0f6226c2d979bf0951923624926dd (patch)
treeee742afe391e8e47f43163bca32f91a284fdc4ef /memcached.h
parentd89ecd3456138c226934ddcdde749e3ba90a45a7 (diff)
downloadmemcached-c25d0bd68ab0f6226c2d979bf0951923624926dd.tar.gz
thread: use eventfd for worker notify if available
now that all of the read/writes to the notify pipe are in one place, we can easily use linux eventfd if available. This also allows batching events so we're not firing the same notifier constantly.
Diffstat (limited to 'memcached.h')
-rw-r--r--memcached.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/memcached.h b/memcached.h
index c475de0..aab21cd 100644
--- a/memcached.h
+++ b/memcached.h
@@ -626,8 +626,12 @@ typedef struct {
pthread_t thread_id; /* unique ID of this thread */
struct event_base *base; /* libevent handle this thread uses */
struct event notify_event; /* listen event for notify pipe */
+#ifdef HAVE_EVENTFD
+ int notify_event_fd; /* notify counter */
+#else
int notify_receive_fd; /* receiving end of notify pipe */
int notify_send_fd; /* sending end of notify pipe */
+#endif
struct thread_stats stats; /* Stats generated by this thread */
struct conn_queue *ev_queue; /* Worker/conn event queue */
cache_t *rbuf_cache; /* static-sized read buffers */