<div dir="ltr">yes Duncan I am trying to pass-by-value. I am familiar with ForeignPtr; however, I don't comprehend what you and Brandon are suggesting to do. Could either of you provide a code illustration or point at existing code to illustrate your approach?<br>
<br>Kind regards, Vasili<br><br><div class="gmail_quote">On Sat, Jul 19, 2008 at 8:28 AM, Duncan Coutts <<a href="mailto:duncan.coutts@worc.ox.ac.uk">duncan.coutts@worc.ox.ac.uk</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d"><br>
On Sat, 2008-07-19 at 01:40 -0500, Galchin, Vasili wrote:<br>
> hello,<br>
><br>
><br>
> Following is more of a criticism of Linux implementation of the<br>
> Posix real-time extension of asynchronous I/O.... if not interesting<br>
> please skip. The central data structure for Posix AIO is an aiocb. In<br>
> any case, the Linux implementors added to the aiocb:<br>
<br>
</div>[..]<br>
<div class="Ih2E3d"><br>
> My viewpoint is that the above "Internal members" must be "carried"<br>
> around in a Haskell program. Am I correct?? If I am correct, then the<br>
> Linux implementation of Posix AIO is not portable to say Solaris? In<br>
> hindsight, if I am correct, it seems that the Linux implementation of<br>
> AIO should use the ordered pair (pid, fd) to reference the "internal"<br>
> members and leave the "aiocb" "clean"?<br>
<br>
</div>Although it is different between platforms it is still portable. When<br>
you allocate memory in C for the aiocb struct you would use<br>
sizeof(aiocb). That's portable even if the size is different on Linux vs<br>
Solaris. Then members are only accessed by name which is again portable.<br>
<br>
Your problem perhaps is that you're trying to convert an aiocb into a<br>
pure haskell version and convert it back and expect to retain all the<br>
information. I think that is a mistake. Don't pass the aiocb's by value,<br>
pass them by reference. Use a ForeignPtr and just access the members you<br>
need whenever you need them.<br>
<font color="#888888"><br>
Duncan<br>
<br>
</font></blockquote></div><br></div>