Subj : Re: Threading and Timeouts To : comp.programming.threads From : David Schwartz Date : Wed Jul 20 2005 05:57 pm "Giancarlo Niccolai" wrote in message news:dbmn30$209$1@newsread.albacom.net... > Ah, NOW I see your point. You say that there is no guarantee that the > socket > (let's focus on that) status may not change after that select() has > decided > it was ready. It may theoretically change also before it returns. Of course. > Well, supposing the socket is used by more threads/process at a time, > without coordination yes. Every socket is used by at least two things, the local end and the remote end. A TCP connection can change at any time due to packets received over the network. A UDP socket can change because an interface can go up or down. > Yet, is this meaningful? How can this impact a correctly written program? A correctly written program cannot assume that a 'select' hit means a future operation will not block because things can change. A route can be lost. Memory pressure can cause data to be discarded or buffers to be shrunk. Anything can happen. The guarantee you claim exists just does not exist. So you just cannot rely on it. It is not my problem to figure out all the possible ways it can fail. You just aren't guaranteed it won't. DS .