Re: CPU consumption with GtkThread
Maxence Guesdon <[email protected]> Wed, 15 Dec 2010 07:43:02 +0100
| Newsgroups | gmane.comp.lang.ocaml.lib.gtk |
|---|---|
| Organization | INRIA |
| Message-ID | <20101215074302.51916f2e@alcazar> |
On Tue, 14 Dec 2010 12:18:00 +0100 Adrien <[email protected]> wrote: > Hi, > > 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érémie 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 () = Lwt_glib.init () > (and of course, link against lwt-glib) > > 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