<div dir="ltr">yes Duncan I am trying to pass-by-value. I am familiar with ForeignPtr; however, I don&#39;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 &lt;<a href="mailto:duncan.coutts@worc.ox.ac.uk">duncan.coutts@worc.ox.ac.uk</a>&gt; 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>
&gt; hello,<br>
&gt;<br>
&gt;<br>
&gt; &nbsp; &nbsp; Following is more of a criticism of Linux implementation of the<br>
&gt; Posix real-time extension of asynchronous I/O.... if not interesting<br>
&gt; please skip. The central data structure for Posix AIO is an aiocb. In<br>
&gt; any case, the Linux implementors added to the aiocb:<br>
<br>
</div>[..]<br>
<div class="Ih2E3d"><br>
&gt; My viewpoint is that the above &quot;Internal members&quot; must be &quot;carried&quot;<br>
&gt; around in a Haskell program. Am I correct?? If I am correct, then the<br>
&gt; Linux implementation of Posix AIO is not portable to say Solaris? In<br>
&gt; hindsight, if I am correct, it seems that the Linux implementation of<br>
&gt; AIO should use the ordered pair (pid, fd) to reference the &quot;internal&quot;<br>
&gt; members and leave the &quot;aiocb&quot; &quot;clean&quot;?<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&#39;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&#39;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&#39;t pass the aiocb&#39;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>