Delivered-To: garrigue at math.nagoya-u.ac.jp Delivered-To: lablgtk at yquem.inria.fr Date: Wed, 15 Dec 2010 07:43:02 +0100 From: Maxence Guesdon To: Adrien Subject: Re: [Lablgtk] CPU consumption with GtkThread Message-ID: <20101215074302.51916f2e at alcazar> In-Reply-To: References: <20101214083626.59faf109 at alcazar> <20101214084959.0c5ce2ef at alcazar> Organization: INRIA Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Cc: lablgtk at yquem.inria.fr Status: U On Tue, 14 Dec 2010 12:18:00 +0100 Adrien wrote: > Hi, >=20 > I actually made it adaptive later on[1]. The drawback was that > animations could take more time to update. The adaptative version > worked quite well but reducing the delay wasn't instantaneous. It was > pretty dumb and experimental, I could probably put more thought in it > if needed. > One of my test was using the acid3 test[2]. Basically, each step of > the animation required one iteration of the loop. So depending on your > uses it might or might not be a good idea. Maybe the GtkThread module could allow setting some kind of callback so that the application could change this delay when needed ? > Then, at the OCaml Hacking Day, J=E9r=E9mie Dimino told me to try Lwt's > support[3]. Since you'll only be using lwt threads, you won't have to > use GtkThread. IIRC it's only a matter of putting the following at the > top of your code instead: > let () =3D Lwt_glib.init () > (and of course, link against lwt-glib) >=20 > Haven't had issues with it and you don't have to use lwt everywhere, > only sections that may take time. I'm a bit reluctant to add such a dependency just for the small gtkthread problem, but thanks for the information. Regards, Maxence=20 _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk