[Haskell-cafe] Re: "C" buffer suggestions??

Galchin, Vasili vigalchin at gmail.com
Mon Jun 23 16:15:42 EDT 2008


On Mon, Jun 23, 2008 at 12:07 PM, Adam Langley <agl at imperialviolet.org>
wrote:

> 2008/6/23 Galchin, Vasili <vigalchin at gmail.com>:
> > Basically I want to model POSIX async io "aiocb"(
> > http://uw714doc.sco.com/en/man/html.5/aiocb.5.html) in Haskell .. in
> > particular the aiocb field "aio_buf"!
>
> That's a mutable buffer, so this has to be pretty low level in your
> wrapping of the AIO interface. I would keep it as a Ptr Word8 at that
> point. ByteStrings are probably the correct type for the user visible
> interface, but I would guess not here.

     I tried to write a test value of Word8 without success. Can you give an
example?

>
>
> Plus, ByteString data lives in the Haskell heap so could get moved
> about by the collector. Since an AIO interface is probably going to
> return while the IO is still in progress, you don't want to stop the
> collector, but nor do you want the data moving because the kernel's
> pointer isn't going to move with it.

       ^^ Interesting about moving around in the heap. I cannot use it for
AIO.

>
>
> AGL
>
> --
> Adam Langley agl at imperialviolet.org http://www.imperialviolet.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080623/b76e650c/attachment.htm


More information about the Haskell-Cafe mailing list