Subject: Re: CVS commit: src/lib/libc/sys
To: None <kpneal@pobox.com>
From: Bill Sommerfeld <sommerfeld@netbsd.org>
List: current-users
Date: 12/30/2002 23:15:08
> Would a single-speed CD-ROM count as slow or not? How about a hard disk
> that has blocks the drive has trouble reading (but eventually, 10 seconds
> from now, manages to read)? How about a vnd device? How about a device
> that actually implements a networked device whose storage lives on
> another machine? (Such devices have been described on this list in the
> past year or so.)

short form: mass storage devices (CD-ROM, disks, filesystems) are
"fast".

terminals, pipes, etc., are "slow".

NFS seems to screw this up as "slow" filesystem.  (This should not
happen for a hard mount).

This distinction is increasingly becoming less meaningful, but there's
a lot of history here.

> What makes a slow device different from a non-slow? Anything? Do slow
> devices allow the race condition that causes EINTR errors and non-slow
> devices do not have this race condition? 

It boils down to whether the implementation of the descriptor (file,
device driver, etc.,) does interruptable or uninterruptable sleeps
when it sleeps.

> In an SMP world?

SMP makes no difference.

> Is this relying on slow vs non-slow devices a portable practice? 

Historically, as you've discovered, a lot of code depends on this.

> Why would NetBSD want to be so much more specific in this one particular
> case than the actual standards document? 
> 
> Is there any good way for a programmer to know for sure whether or not
> "slow" devices will be used as sources or destinations of data? If not
> then why should the man page even bother to mention this distinction?
> 
> Why would NetBSD want to have stuff in it's documentation that encourages
> the coding of broken programs? 

Historicaly, there have been two aspects to man pages:
 - a specification to users.
 - a specification to implementors.

Because there is a lot of historic code which depends on filesystem
I/O never returning EINTR, we should move cautiously, if at all, with
respect to weakening this.

I'm inclined to tweak the text with respect to mention of "slow" -- at
least to include it as "historic" behavior..

> Ok, so what's a device? Is it a regular file? 

No.

> Is this really, REALLY so big of a deal that NetBSD MUST keep this mention
> of "slow" devices in it's man pages? Really? Why?

Yes.

					- Bill