[Lablgtk] CPU consumption with GtkThread
Maxence.Guesdon at inria.fr
Wed Dec 15 07:43:02 CET 2010
On Tue, 14 Dec 2010 12:18:00 +0100
Adrien <camaradetux at gmail.com> wrote:
> I actually made it adaptive later on. 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. 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. 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.
Lablgtk mailing list
Lablgtk at yquem.inria.fr
More information about the Lablgtk-list