The data structure of MSG is given first:
Truct MSG {tailq_entry (msg) C_TQE; tailq_entry (msg) S_TQE; tailq_entry (msg) M_TQE; uint64_t Id int route_ Idx struct msg *peer; struct Conn *owner; struct Rbnode tmo_rbe; struct MHDR mhdr; uint32_t mlen; int state; uint8_t *pos; uint8_t *token; msg_parse_t parser; msg_parse_result_t Result mbuf_copy_t pre_splitcopy; msg_post_splitcopy_t post_splitcopy; msg_coalesce_t pre_coalesce; msg_coalesce_t post_coalesce; msg_type_t type ; uint8_t *key_start; uint8_t *key_end; uint32_t vlen; uint8_t *end; uint8_t *narg_start; uint8_t *narg_end; uint32_t narg; uint32_t rnarg; uint32_t rlen; uint32_t integer; struct msg *frag_owner; uint32_t nfrag; uint64_t frag_id; err_t err; unsigned error:1; unsigned ferror:1; unsigned request:1; unsigned quit:1; unsigned noreply:1; unsigned done:1; unsigned fdone:1; unsigned first_fragment:1; unsigned last_fragment:1; unsigned swallow:1; unsigned redis:1; |
See these three members of Tailq_entry (msg) C_TQE;tailq_entry (msg) S_TQE; tailq_entry (msg) M_TQE; C_TQE is an input or output queue that is used to insert input into the conn of the client type or output queue s_tqe is used to insert into the conn of the type of server (that is, Conn that connects to the back-end Redis server) m_ TQE is used to insert into a send-to column (a send queue corresponding to a remote or client or redisinstance) in the input or output queue of the specific insertion and deletion process see the previous article.
Twemproxy source analysis of the five: zero copy