Delivered-To: garrigue at math.nagoya-u.ac.jp Authentication-Results: mailhost.math.nagoya-u.ac.jp sender=lablgtk-bounces at yquem.inria.fr; domainkey=neutral (no query protocol specified; no policy for yquem.inria.fr) Delivered-To: lablgtk at yquem.inria.fr DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type; bh=TJuDKJ2mJ1Voo+QW0HioQeioNmjrx8GihIxJ2lRdAp8=; b=ne4rrCEaWY4QhS6oecIJWTyFWM/cOAVcO3qAlTUm2degJO78Ewq5s14hUeTcOxALaf 7Php+npfuSYR8lXC1UkqHitno9vIUrkw9Sf/zzJfqbO561rAzUysAPpaxYNfpQxReVTa uL7gyQotiPX6X7C4F2/X3f+qasgoX1Ve6Rric= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=Ho8Cx+WcWF4x6Jpl0EevTzqOEZpYM8tIKL7COFhLXcKJzhvtvXeSfxvT4Ei3cgXr1V 6GGcRAzKns1CTYEGzS2ygmnQv2tdVKyRgGOZilo4R6vy4WO0zxLd9ZO++Ge++Hsqiylx gOypxuO2/3lXZs4LmUMaag9wBDNddndYY1mN8= MIME-Version: 1.0 Date: Mon, 21 Dec 2009 00:47:13 +0100 Message-ID: <666572260912201547s4c4eff69s13c08d841939a87d at mail.gmail.com> Subject: [Lablgtk] Non-zero CPU usage when using threads From: Adrien To: lablgtk Content-Type: text/plain; charset=ISO-8859-1 Hi, I've been surprised to see my app use 1% - 2% of my CPU. I've reduced the test case down to: let () = GtkThread.main () Compiled with: ocamlcp -I /ocaml/lib/ocaml/std-lib/threads -I /ocaml/lib/ocaml/pkg-lib/lablgtk2 unix.cma threads.cma lablgtk.cma gtkThread.cmo -p a cpu.ml I found that by editing gtkThread.ml, I could lower the cpu usage: - Thread.delay 0.001; + Thread.delay 0.013; I've put a local copy of gtkThread.ml with the aforementioned change in my code (I'm not sure it's ok license-wise but currently caravel's license is almost left unspecified) [1]. I'd like comments on this: how is it, any good/better solution? [1] http://git.ocamlcore.org/cgi-bin/gitweb.cgi?p=caravel/caravel.git;a=commitdiff;h=81e7a6c32dcc72eadb4233f7d08b1d5885a455c8 _______________________________________________ Lablgtk mailing list Lablgtk@yquem.inria.fr http://yquem.inria.fr/cgi-bin/mailman/listinfo/lablgtk