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
Creating wrappers for C libraries
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-12-08 (10:18)
From: David Baelde <david.baelde@g...>
Subject: Re: [Caml-list] Creating wrappers for C libraries

One problem with such automated tools is that they have no clue of
which C function takes time and which returns almost instantly. And
these things matter in OCaml, as soon as you use your wrapper in
multithreaded programs: the time-consuming functions should be wrapped
around enter/leave_blocking_section() (and the ocaml data copied to
places untouched by the Gc) so that other caml threads can run while
the function is performed.

However, for libsndfile, most functions are very fast, so I guess you
can try automatic tools.