60a Subj : Re: Threading and Timeouts To : comp.programming.threads From : David Schwartz Date : Wed Jul 20 2005 05:51 pm "Giancarlo Niccolai" wrote in message news:dbml2b$ec$1@newsread.albacom.net... > Again, we are talking about blocking in wait for the system to be ready to > accept data. I.E. In case of sync i/o write() is forced to wait untill > all > data are phisically gone on the media. What select() GUARANTEES is that > the > fd is in a status that, if it were O_NONBLOCK, then it may not return > EAGAIN, that is to say, that the system will immediately process *at > least* > part of the data that can be sent on the fd. Except that it doesn't guarantee this. This is a common, but totally mistaken, belief. The 'select' function calls gives you information that is correct for some time interval between when you called 'select' and when it returns about what would have happened to a socket operation in that time period. It provides no future guarantees, and the standards are very careful *NOT* to say it does. This is the same for every other status function. For example, does a call to 'access' guarantee that a future access will succeed? Of course not. Anything can change in-between when 'access' returns and when you attempt the access, and nothing in POSIX requires anything to remain true later. I defy you to find any statement that says or implies a *future* guarantee about what *will* or *must* happen later. DS . 0