On Jan 6, 2004, at 12:47 AM, David Schwartz wrote:

In most cases multi threads and only one SOCKET don't really get along.

I'm not sure why you'd say that. For TCP, reading and writing are totally
independent. Using a pool of threads for I/O is quite common to protect
against ambush (when an operation that shouldn't block unexpectedly does) or
to take advantage of SMP machines.




Indeed, before the advent of threads one could (on unix anyway) handle reading and writing of a single tcp connection via two separate processes since child processes inherit all open descriptors of the parent.

[I suspect (based on the all-caps spelling of SOCKET and the sample code provided earlier) that Mr. Giudicelli speaks from a Windows perspective, which doesn't handle multiple processes very well, and certainly does not abstract tcp sockets into simple file descriptors the way unix does.]

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to