Version française
Home     About     Download     Resources     Contact us    
Browse thread
Help interfacing with C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Bardur Arantsson <spam@s...>
Subject: Re: Help interfacing with C
Nathaniel Gray wrote:
> On 8/18/06, Bardur Arantsson <spam@scientician.net> wrote:
>> Nathaniel Gray wrote:
>> > On 8/16/06, Bardur Arantsson <spam@scientician.net> wrote:
>> >> Nathaniel Gray wrote:
>> >> > Hi folks,
>> >> [--snip--]
> Let me be clear about this -- it's not really about performance.  I'm
> looking at the entire sequence of operations and data structures
> needed to make a select call.  Here's a typical example with the
> current API:
[--snip-- example --snip--]

Ok, I did understand _what_ you are trying to do, I'm just not sure why 
anyone wouldn't choose the path of least resistance -- a solution in C 
is likely to be more error-prone (as you've discovered ;)) and harder to 
maintain if there are changes in OCaml internals -- whereas Unix.select 
is likely to remain that way "forever". Of course if the aim of the 
whole exercise is to get the modified select included in OCaml then I 
guess there's your motivation for doing it in C ;).

However, if you just want a nicer interface then there are other 
solutions such as Gerd Stolpmann's "Equeue" framework. I would just use 
that instead of worrying about Unix.select. It provides much nicer 
abstractions:

    http://www.ocaml-programming.de/packages/documentation/equeue/

Cheers,

-- 
Bardur Arantsson
<bardurREMOVE@THISscientician.net>

- If you can remember drinking it, you obviously didn't drink
enough of it.
                                                                Me