-------- Original Message -------- Subject: Re: [Caml-list] Re: announce: callbacks-0.1 Date: Fri, 09 Sep 2005 11:41:38 +0200 From: Christophe Raffalli To: Bardur Arantsson References: <43206744.5090907@univ-savoie.fr> <4320A68E.1060608@xs4all.nl> <4320ABF7.7020009@univ-savoie.fr> <43214CC8.8070506@univ-savoie.fr> <20050909091644.GC2895@scientician.net> Bardur Arantsson wrote: > On Fri, Sep 09, 2005 at 10:50:16AM +0200, Christophe Raffalli wrote: > > >>Bardur Arantsson wrote: >> >>>On Fri, Sep 09, 2005 at 07:53:17AM +0200, Christophe Raffalli wrote: > > >>>That depends hugely on what kind of library you're wrapping. I did a >>>wrapper for libevent (events on file descriptors and other similar stuff >>>like alarms, etc.) and what ended up happening was that a 1) lot of the >>>time a relatively large amount of callbacks were registered, orm 2) >>>callbacks would be registered/unregistered a lot. I did try using >>>*_global_roots in my libevent wrapper, but the performance was awful >>>until I changed it to use an (fd->callback) hashtable on the OCaml side. > > >>>(In the case of file descriptors or similar objects you can try to be >>>more clever and just use an array of callbacks and use the file >>>descriptor as the index; I didn't bother with this in my wrapper library >>>since the performance was OK as it was). > > >>agree with all that ... I might even provide some camlp4 extension to >>handle the mechanism with hashtbl and callbacks (still in the spirit of >>simplifying the life of people writing bindings) > > > Cool. It's not that I don't appreciate what you're trying > to do, it's just that I think it's harder to do this is > general than it's worth wrt. avoiding some of the more > annoying aspects of creating bindings. > For Glut (where the current implementation (inside lablGL-1.0) is quite wrong as soon as you have two windows), I think I will not loose that many hours writing my tools and using it rather than doing everything at the end. Moreover, I had some fun and some pb to solve instead of doing a boring job !!! > Good luck anyway :) > > -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net --------------------------------------------- -- Christophe Raffalli Université de Savoie Batiment Le Chablais, bureau 21 73376 Le Bourget-du-Lac Cedex tél: (33) 4 79 75 81 03 fax: (33) 4 79 75 87 42 mail: Christophe.Raffalli@univ-savoie.fr www: http://www.lama.univ-savoie.fr/~RAFFALLI --------------------------------------------- IMPORTANT: this mail is signed using PGP/MIME At least Enigmail/Mozilla, mutt or evolution can check this signature. The public key is stored on www.keyserver.net ---------------------------------------------