Eric Rescorla wrote,
> The man page says:
  ^^^
Huh? Which platform?

I'd be more impressed by POSIX chapter and verse, but even that's 
irrelevant because all it might or might not tell us is that many 
platforms aren't fully POSIX compliant.

>   select() examines the I/O descriptor sets whose addresses are 
>   passed in readfds, writefds, and exceptfds to see if some of their 
>   descriptors are ready for reading, are ready for writing, or have 
>   an exceptional condition pending, respectively.
>
> "won't block on read/write" seems like a reasonable interpretation 
> of "ready for reading..."

Maybe reasonable, but wrong.

Even if POSIX mandates the behaviour you're claiming, and even if we
ignored the considerations David Schwartz raised, the most we could 
say is that the descriptor *was* readable/writable at the point at 
which it was examined by select. Any actual read/write occurs later, 
leaving a nice big window of opportunity for races (eg. another thread 
might consume all available input before the selecting thread gets a 
shot at it).

Cheers,


Miles

-- 
Miles Sabin                                     InterX
Internet Systems Architect                      27 Great West Road
+44 (0)20 8817 4030                             Middx, TW8 9AS, UK
[EMAIL PROTECTED]                               http://www.interx.com/

______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to