summaryrefslogtreecommitdiffhomepage
path: root/src/event/ngx_event_pipe.h
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2016-03-18 06:44:49 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2016-03-18 06:44:49 +0300
commit348f705c000bdbfbee74d6f0111a03697f8ffa4f (patch)
tree257c01008977e51e7dd44b0d69d1795d4bb362ce /src/event/ngx_event_pipe.h
parent10c8c8d6a47db5e84825479438ce5848b2d1dda4 (diff)
downloadnginx-348f705c000bdbfbee74d6f0111a03697f8ffa4f.tar.gz
nginx-348f705c000bdbfbee74d6f0111a03697f8ffa4f.tar.bz2
Threads: writing via threads pools in event pipe.
The "aio_write" directive is introduced, which enables use of aio for writing. Currently it is meaningful only with "aio threads". Note that aio operations can be done by both event pipe and output chain, so proper mapping between r->aio and p->aio is provided when calling ngx_event_pipe() and in output filter. In collaboration with Valentin Bartenev.
Diffstat (limited to 'src/event/ngx_event_pipe.h')
-rw-r--r--src/event/ngx_event_pipe.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/event/ngx_event_pipe.h b/src/event/ngx_event_pipe.h
index 451fc4c05..ef2e7a006 100644
--- a/src/event/ngx_event_pipe.h
+++ b/src/event/ngx_event_pipe.h
@@ -30,6 +30,8 @@ struct ngx_event_pipe_s {
ngx_chain_t *in;
ngx_chain_t **last_in;
+ ngx_chain_t *writing;
+
ngx_chain_t *out;
ngx_chain_t *free;
ngx_chain_t *busy;
@@ -45,6 +47,13 @@ struct ngx_event_pipe_s {
ngx_event_pipe_output_filter_pt output_filter;
void *output_ctx;
+#if (NGX_THREADS)
+ ngx_int_t (*thread_handler)(ngx_thread_task_t *task,
+ ngx_file_t *file);
+ void *thread_ctx;
+ ngx_thread_task_t *thread_task;
+#endif
+
unsigned read:1;
unsigned cacheable:1;
unsigned single_buf:1;
@@ -56,6 +65,7 @@ struct ngx_event_pipe_s {
unsigned downstream_done:1;
unsigned downstream_error:1;
unsigned cyclic_temp_file:1;
+ unsigned aio:1;
ngx_int_t allocated;
ngx_bufs_t bufs;