My client program receives and sends data simultaneously upon the same Windows Socket. For these means, I utilize two threads - for reading and writing, correspondingly. To prevent bizarre behavior, should I put a mutex on using the socket itself or two mutexes on reading and writing - apart - to speed up the transfer? I am on C++.
Asked
Active
Viewed 32 times
0
-
A mutex on the socket is not needed, and two mutexes do not make much sense. You may need a mutex or even two on your other data, but without knowing what that data is, it is impossible to tell. – n. 1.8e9-where's-my-share m. Feb 07 '22 at 12:36