diff options
Diffstat (limited to 'libglusterfs/src/event.h')
-rw-r--r-- | libglusterfs/src/event.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/libglusterfs/src/event.h b/libglusterfs/src/event.h index 3b3ab0e4b2f..930a7d1e28b 100644 --- a/libglusterfs/src/event.h +++ b/libglusterfs/src/event.h @@ -33,6 +33,7 @@ typedef int (*event_handler_t) (int fd, int idx, void *data, #define EVENT_EPOLL_TABLES 1024 #define EVENT_EPOLL_SLOTS 1024 +#define EVENT_MAX_THREADS 32 struct event_pool { struct event_ops *ops; @@ -53,10 +54,16 @@ struct event_pool { void *evcache; int evcache_size; + + /* NOTE: Currently used only when event processing is done using + * epoll. */ + int eventthreadcount; /* number of event threads to execute. */ + pthread_t pollers[EVENT_MAX_THREADS]; /* poller thread_id store, + * and live status */ }; struct event_ops { - struct event_pool * (*new) (int count); + struct event_pool * (*new) (int count, int eventthreadcount); int (*event_register) (struct event_pool *event_pool, int fd, event_handler_t handler, @@ -71,9 +78,12 @@ struct event_ops { int idx); int (*event_dispatch) (struct event_pool *event_pool); + + int (*event_reconfigure_threads) (struct event_pool *event_pool, + int newcount); }; -struct event_pool * event_pool_new (int count); +struct event_pool *event_pool_new (int count, int eventthreadcount); int event_select_on (struct event_pool *event_pool, int fd, int idx, int poll_in, int poll_out); int event_register (struct event_pool *event_pool, int fd, @@ -82,5 +92,6 @@ int event_register (struct event_pool *event_pool, int fd, int event_unregister (struct event_pool *event_pool, int fd, int idx); int event_unregister_close (struct event_pool *event_pool, int fd, int idx); int event_dispatch (struct event_pool *event_pool); +int event_reconfigure_threads (struct event_pool *event_pool, int value); #endif /* _EVENT_H_ */ |