[UNIX][ALPHA][NET] When to tap the r/w sems?
lex at cc.gatech.edu
Thu Aug 3 13:08:15 UTC 2000
"Peter Crowther" <peter at crowther.demon.co.uk> wrote:
> > From: Lex Spoon [mailto:lex at cc.gatech.edu]
> > select() tells you whether a socket is read-able or not, but
> > it doesn't tell you when it *becomes* readable.
> True, but at least two platforms have ways of telling you. SIGIO in many
> UNIXes is a good prompt to run a select() to see what's changed, and with
> WinSock you can ask for socket events on your event queue. I'm not enough
> of a Mac coder to know whether, or how, similar things could be handled
Ian used SIGIO for a while, but it's not the same on all platforms. So
he dropped back to using select().
select() is fairly well defined and quite reliable. Calling it twice in
a row isn't going to be *tooo* expensive, and anyway, as I/O becomes
really heavy, there tend to be more "hits" per select and so the
overhead becomes less significant.
More information about the Squeak-dev