Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
From: David Baelde <david.baelde@g...>
Subject: Re: [Caml-list] Creating wrappers for C libraries
Hi,

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.

Cheers.
-- 
David