I need to manage multiple socket connections to a server. Each one can
have data that needs to be read or written at any time. I would like to
be able to read and write data as it becomes available without having to
poll for it. I am targetting Mac OS X and Linux at a minimum.
The usual way to avoid polling on a read is to use select(), but what
happens if data becomes available for writing while the thread is
waiting on select() or blocking on a read? Do I have to use a separate
thread for writing? If so, are there synchronization issues I shold be
aware of for reading and writing to the same socket at the same time in
Would nonblocking I/O be simpler to implement instead?
Thanks for any advice,