From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 41DE1BB83 for ; Fri, 7 Jul 2006 03:25:31 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k671PWRu006902 for ; Fri, 7 Jul 2006 03:25:32 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA21997 for ; Fri, 7 Jul 2006 03:25:31 +0200 (MET DST) Received: from mz1.forethought.net (mzpi3.forethought.net [216.241.36.12]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k671PPTG006089 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Fri, 7 Jul 2006 03:25:31 +0200 Received: from [216.241.35.41] (helo=[10.0.0.2]) by mz1.forethought.net with esmtp (Exim 4.51) id 1Fyf5q-00039S-UF for caml-list@inria.fr; Thu, 06 Jul 2006 19:25:19 -0600 Message-ID: <44ADB830.2040301@gushee.net> Date: Thu, 06 Jul 2006 19:26:08 -0600 From: Matt Gushee User-Agent: Thunderbird 1.5.0.4 (X11/20060615) MIME-Version: 1.0 To: caml-list@inria.fr Subject: SOLVED -- Re: [Caml-list] LablGTK app maxes out CPU References: <44AAB3B3.6000807@gushee.net> <20060704191216.GA15888@localhost> <44AAC8EE.1060805@gushee.net> <20060704202117.GB15987@localhost> <44AC4A46.3070105@gushee.net> <20060706165121.GA4165@strontium.pps.jussieu.fr> <44ADA1E9.7070106@gushee.net> In-Reply-To: <44ADA1E9.7070106@gushee.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 44ADB80C.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44ADB805.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lablgtk:01 util:01 omitted:01 gmain:01 widget:01 gmain:01 0.25:98 wrote:01 caml-list:01 int:01 cond:02 cond:02 callback:02 callback:02 solved:03 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 Matt Gushee wrote: > Well, based on the above, I tried adding a second watch function: > > let hup_watcher _ = Util.sleep 0.25; true in > (* ... unrelated code omitted ... *) > ignore (GMain.Io.add_watch ~cond:[`HUP] ~callback:hup_watcher chan) > > Finally, this produces a change in behavior--but not quite what I need. > CPU usage is under control, but now the GUI fails to display completely: > the main window appears, with the outine of the TreeView widget it is > supposed to have, but the contents are never displayed. I was on the right track with the above--I just needed to set the hup_watcher to a lower priority, e.g. let low_priority = Glib.int_of_priority `LOW in .... ignore (GMain.Io.add_watch ~prio:low_priority ~cond:[`HUP] ~callback:hup_watcher chan) I'm not sure whether `LOW or `DEFAULT_IDLE is best, but both seem to produce good results. Many thanks to those who helped. -- Matt Gushee : Bantam - lightweight file manager : matt.gushee.net/software/bantam/ : : RASCL's A Simple Configuration Language : matt.gushee.net/rascl/ :