Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-15 Thread Richard A. O'Keefe
On 15 Aug 2008, at 12:17 pm, Brandon S. Allbery KF8NH wrote: Actually, while I'm not sure how Linux does it, on the *BSDs pipes are actually socketpairs. This raises the question, which the documentation did not make clear to me, whether a named pipe is a pipe. One would hope it was, but

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-15 Thread Brandon S. Allbery KF8NH
On 2008 Aug 15, at 2:23, Richard A. O'Keefe wrote: On 15 Aug 2008, at 12:17 pm, Brandon S. Allbery KF8NH wrote: Actually, while I'm not sure how Linux does it, on the *BSDs pipes are actually socketpairs. This raises the question, which the documentation did not make clear to me, whether

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-15 Thread Tony Finch
On Thu, 14 Aug 2008, Brandon S. Allbery KF8NH wrote: Actually, while I'm not sure how Linux does it, on the *BSDs pipes are actually socketpairs. Not any more. FreeBSD replaced the socketpair implementation with a faster one in 1996 and OpenBSD imported it soon after. NetBSD imported it in

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-15 Thread Brandon S. Allbery KF8NH
On 2008 Aug 15, at 9:34, Tony Finch wrote: On Thu, 14 Aug 2008, Brandon S. Allbery KF8NH wrote: Actually, while I'm not sure how Linux does it, on the *BSDs pipes are actually socketpairs. Not any more. FreeBSD replaced the socketpair implementation with a faster one in 1996 and

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-14 Thread Brandon S. Allbery KF8NH
On 2008 Aug 14, at 2:28, Ketil Malde wrote: Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes: Your previously stated use case sounds like a good fit. I can easily imagine sendfile() implementations starving other network operations, though (and IIRC linux's early sendfile() implementation

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-14 Thread Ketil Malde
Brandon S. Allbery KF8NH [EMAIL PROTECTED] writes: On 2008 Aug 13, at 18:25, Jason Dusek wrote: Can you say more about this? I assume that sending static images back and forth is a good fit for sendfile(). Your previously stated use case sounds like a good fit. I can easily imagine

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-14 Thread Richard A. O'Keefe
On 14 Aug 2008, at 6:28 pm, Ketil Malde wrote: Isn't [sendfile()] superseeded by splice(2) nowadays? Solaris 10: f% man splice No manual entry for splice Mac OS X 10.5.4 m% man splice No manual entry for splice Linux 2.6.23... o% man splice .. one of the descriptors MUST refer

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-14 Thread Brandon S. Allbery KF8NH
On 2008 Aug 14, at 19:07, Richard A. O'Keefe wrote: to me, two of them don't have it, and the third seems to be saying you cannot use it to move data from a file (which is not a pipe) to a socket (which is not a pipe), which is the use-case for sendfile(). Actually, while I'm not sure how

[Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Jason Dusek
I found an old lib for it: http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html Hoogle turns up nothing, though. -- _jsn ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Chaddaï Fouché
2008/8/13 Jason Dusek [EMAIL PROTECTED]: I found an old lib for it: http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html Hoogle turns up nothing, though. That don't sound very useful... Maybe when we only had String it was much more performant for big transfert, but now

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Brandon S. Allbery KF8NH
On 2008 Aug 13, at 15:01, Chaddaï Fouché wrote: 2008/8/13 Jason Dusek [EMAIL PROTECTED]: I found an old lib for it: http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html Hoogle turns up nothing, though. That don't sound very useful... Maybe when we only had String it was

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Jason Dusek
Chaddaï Fouché [EMAIL PROTECTED] wrote: Maybe when we only had String it was much more performant for big transfert, but now we can recode this in one short line of ByteString code and get the same performance as C. Oh? Using lazy ByteString? -- _jsn

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Brandon S. Allbery KF8NH
On 2008 Aug 13, at 15:04, Brandon S. Allbery KF8NH wrote: On 2008 Aug 13, at 15:01, Chaddaï Fouché wrote: 2008/8/13 Jason Dusek [EMAIL PROTECTED]: I found an old lib for it: http://www.haskell.org/ghc/docs/6.0/html/unix/System.Sendfile.html Hoogle turns up nothing, though. That don't

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Chaddaï Fouché
2008/8/13 Brandon S. Allbery KF8NH [EMAIL PROTECTED]: I should clarify: what sendfile() is supposed to optimize isn't writing large strings, or even the user-kernel roundtrips; it's an optimization to the kernel network stack (network buffer management, to be specific). Web servers use it

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Jason Dusek
Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: I should clarify: what sendfile() is supposed to optimize isn't writing large strings, or even the user-kernel roundtrips; it's an optimization to the kernel network stack (network buffer management, to be specific). Web servers use it to

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Jason Dusek
Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: Right. I intended that to be a heads-up in both directions: it is not simply a library convenience function, so one needs to think about when to use it. In particular, it's possible that overuse of sendfile() in the wrong circumstances will

Re: [Haskell-cafe] whatever happened to sendFile?

2008-08-13 Thread Brandon S. Allbery KF8NH
On 2008 Aug 13, at 18:25, Jason Dusek wrote: Brandon S. Allbery KF8NH [EMAIL PROTECTED] wrote: Right. I intended that to be a heads-up in both directions: it is not simply a library convenience function, so one needs to think about when to use it. In particular, it's possible that overuse of