[En-Nut-Discussion] TCPSend thread safe

Nathan Moore nategoose at gmail.com
Thu May 15 16:39:55 CEST 2008


On Thu, May 15, 2008 at 4:43 AM, Nicolas Moreau <moreau at gmail.com> wrote:

> Thanks for you reply, I understand how the threading works.
> My questions related more to the TCP state machine, what happens for
> example if the RX is sending the ack for some data it just received
> and the send thread starts sending one.
> Will the state machine cope ? Or will the ACK and my send get mixed up ?
>

We have been doing this without any problems.  Not to say that I know that
there aren't any
problems with it, but we haven't had any problems that we attributed reading
in one thread
while writing to another.
As far as sending an ACK for one packet while another thread tries to send
another packet,
that would need to be handled anyway because with TCP even if you aren't
reading from the
socket a new packet coming in needs to be accepted and ACKed anyway and then
the data
should be there when you do read from the socket.

Nathan



More information about the En-Nut-Discussion mailing list