[Tutor] fcntl: Blocking or non-blocking

Ignacio Vazquez-Abrams ignacio@openservices.net
Wed, 29 Aug 2001 02:37:01 -0400 (EDT)

On Tue, 28 Aug 2001, Sheila King wrote:

> :Blocking in general is Evil unless you know exactly what you're doing.
> Well, that leaves me out. I guess that answers that question.

It's not so much for you as it is for the users of your module. In fact, =
might want to give them the option between blocking and non-blocking so t=
the self-foot-shooting transfers from you to them ;)

Also,=A0I recommend not doing non-block retries at a level that is invisi=
ble to
casual users of your code. There is no point in using non-blocking code i=
f it
appears as though the code blocks _anyway_. Certainly you can provide sam=
code on how to do retries in _their_ code properly, but don't let people =
your code is less functional than it actually is. Less-intelligent people
might appreciate it, but it will just frustrate the hell out of anyone wh=
o can
see it for what it is.

Besides, if you give them a choice, the less-intelligent people will use =
blocking calls anyways, so there's no point in doing extra work for peopl=
e on
POSIX-compliant systems when there is a code-free alternative available.

Ignacio Vazquez-Abrams  <ignacio@openservices.net>