English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2006-08-19 (06:14)
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 



Bardur Arantsson

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