summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_port_memory_int.h (follow)
AgeCommit message (Collapse)AuthorFilesLines
2018-06-20Fixed allocation of multiple shared memory chunks.Max Romanov1-4/+11
Previously, one shared memory chunk was allocated under mutex and other chunks (if required) were allocated using atomic operations. So such allocation is not guaranteed and the result buffer can be less than requested. This commit moves multiple chunks allocation under mutex and guarantees the result buffer is large enough.
2017-12-27Implementing the ability to cancel request before worker starts processing it.Max Romanov1-18/+26
2017-10-19Introducing mmap_handler to count references to shared memory.Max Romanov1-1/+6
"All problems in computer science can be solved by another level of indirection" Butler Lampson Completion handlers for application response buffers executed after sending the data to client. Application worker can be stopped right after send response buffers to router. Worker stop causes removal of all data structures for the worker. To prevent shared memory segment unmap, need to count the number of buffers which uses it. So instead of direct reference to shared memory, need to reference to intermediate 'handler' structure with use counter and pointer to shared memory.
2017-10-19Introducing src_pid for mmap header for accurate buf completion.Max Romanov1-1/+2
This allows to use shared memory to communicate with main process. This patch changes shared memory segment format and breaks compatibility with older modules.
2017-09-18Fixing shared memory thread safety issue.Max Romanov1-0/+1
Do not reuse shared memory segment with different port until this segment successfully received and indexed on other side. However, segment can be used to transfer data via the port it was sent at any time.
2017-06-23Store pointer to shared memory start in buf->parent.Max Romanov1-0/+179
nxt_port_mmap_t stored in arrays and it is unsafe to store pointer to array element. Shared memory structures and macros moved to separate header file to be used by GO package.