Open particle128 opened 5 years ago
Hi,
closeq_int
exists to defer the actions for the streams in the control list and invoke the actions again when conditions are met. For example, if there is another control packet to transmit prior to sending FIN
, we have to wait until FIN
is sent first.
There is also slight difference between closeq
and closeq_int
. closeq
is a single-directional lock-free queue to deliver streams to close from an application thread to an mtcp thread. At the part of the code, we are deferring the action because the stream is in the control list. However, we cannot put the stream back into closeq
since we are in an mtcp thread. So we made closeq_int
that is only accessed inside mtcp thread.
I hope this answers your question.
I see. Thanks a lot for your explanation.
So, closeq_int
means closeq internal
, which is be used in the same mtcp thread, while closeq
can be pushed in business thread and popped in mtcp thread, right?
You're right. closeq_int
is for internal use whereas closeq
is a queue for inter-thread communication.
Hi eunyong14,
I'm confused in reading HandleApplicationCalls in core.c. What's the purpose of closeq_int? Is it equal to "ignoring the closeq stream if it's on the control list"? But if so, we do not even need this structure, right?
I should have missed something, and am really looking forward for your reply. Thanks very much.