Browse thread
Creating wrappers for C libraries
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ 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 |
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