Changing router to application shared memory exchange protocol.

The application process needs to request the shared memory segment from the
router instead of the latter pushing the segment before sending a request to
the application.  This is required to simplify the communication between the
router and the application and to prepare the router for using the application
shared port and then the queue.
This commit is contained in:
Max Romanov
2020-08-11 19:20:13 +03:00
parent 3cbc22a6dc
commit 6e31d6cd39
8 changed files with 374 additions and 179 deletions

View File

@@ -27,6 +27,7 @@ struct nxt_port_handlers_s {
nxt_port_handler_t new_port;
nxt_port_handler_t get_port;
nxt_port_handler_t mmap;
nxt_port_handler_t get_mmap;
/* New process */
nxt_port_handler_t process_created;
@@ -80,6 +81,7 @@ typedef enum {
_NXT_PORT_MSG_NEW_PORT = nxt_port_handler_idx(new_port),
_NXT_PORT_MSG_GET_PORT = nxt_port_handler_idx(get_port),
_NXT_PORT_MSG_MMAP = nxt_port_handler_idx(mmap),
_NXT_PORT_MSG_GET_MMAP = nxt_port_handler_idx(get_mmap),
_NXT_PORT_MSG_PROCESS_CREATED = nxt_port_handler_idx(process_created),
_NXT_PORT_MSG_PROCESS_READY = nxt_port_handler_idx(process_ready),
@@ -247,6 +249,11 @@ typedef struct {
} nxt_port_msg_get_port_t;
typedef struct {
uint32_t id;
} nxt_port_msg_get_mmap_t;
/*
* nxt_port_data_t size is allocation size
* which enables effective reuse of memory pool cache.