]> git.kaiwu.me - nginx.git/commit
Threads: offloading of temp files writing to thread pools.
authorMaxim Dounin <mdounin@mdounin.ru>
Fri, 18 Mar 2016 03:44:03 +0000 (06:44 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Fri, 18 Mar 2016 03:44:03 +0000 (06:44 +0300)
commit10c8c8d6a47db5e84825479438ce5848b2d1dda4
tree138823fa36c8dd88561aa8da309fa062ec597eba
parentac78b26324a348ebdd108de0c022729b671549fb
Threads: offloading of temp files writing to thread pools.

The ngx_thread_write_chain_to_file() function introduced, which
uses ngx_file_t thread_handler, thread_ctx and thread_task fields.
The task context structure (ngx_thread_file_ctx_t) is the same for
both reading and writing, and can be safely shared as long as
operations are serialized.

The task->handler field is now always set (and not only when task is
allocated), as the same task can be used with different handlers.

The thread_write flag is introduced in the ngx_temp_file_t structure
to explicitly enable use of ngx_thread_write_chain_to_file() in
ngx_write_chain_to_temp_file() when supported by caller.

In collaboration with Valentin Bartenev.
src/core/ngx_file.c
src/core/ngx_file.h
src/os/unix/ngx_files.c
src/os/unix/ngx_files.h