[Haskell-cafe] How can I avoid buffered reads?

Brandon Allbery allbery.b at gmail.com
Thu Dec 6 22:39:40 CET 2012


On Thu, Dec 6, 2012 at 3:24 PM, Tristan Seligmann
<mithrandi at mithrandi.net>wrote:

> On 29 Nov 2012 12:27 PM, "Leon Smith" <leon.p.smith at gmail.com> wrote:
> System.Posix.IO and Foreign.    This appears to work,  but for better or
> worse,   it is using blocking calls to the "read" system call and is not
> integrated with GHC's IO manager.   This shouldn't be an issue for my
> purposes,  but I suppose it's worth pointing out.
>
> Reading from an fd corresponding to an actual file is always blocking.
> select() will always indicate that the fd is ready for reading and writing,
> and I think epoll() will refuse to operate on the fd at all.
>
This; it's a longstanding gripe among those of us who use network
filesystems heavily, since it's entirely possible those reads *will*
block... but the usual architecture of Unix-like kernel filesystem code
doesn't provide any way to see it or do anything about it.  (This is also
why NFS "hard" mounts are annoying and "soft" mounts are terrible fragile
hacks.  It's no better with any other network filesystem; they just default
to the "hard" behavior because the "soft" hack, when even possible, is even
worse for most of them.)

-- 
brandon s allbery kf8nh                               sine nomine associates
allbery.b at gmail.com                                  ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20121206/5406c1d1/attachment.htm>


More information about the Haskell-Cafe mailing list