In a C program using POSIX TCP sockets, I want to have one thread doing blocking reads (which extracts data packets and asynchronously sends them as events to the main thread) and another thread writing to the same socket at arbitrary times.
Will this work and be portable if I implement this in the "obvious" naive way, or will there be issues with thread affinity, concurrent reading/writing, or other issues?