I posted a question on SO whether two threads can simultaneously execute a
send() and a
recv() on the same socket. I was told that while they could, implementing this was an example of a very poor design.
My rationale is that packets must be sent every 20ms, so I cannot wait until I receive something before I send anything. I thought designating a thread to perform the sending will make it easiest to keep this 20ms interval untouched by any unrelated processing overhead.
Why is it such a bad idea and what are better designs?