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 DBD3CBB83 for ; Thu, 6 Jul 2006 18:51:33 +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 k66GpY8M031936 for ; Thu, 6 Jul 2006 18:51:34 +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 SAA15740 for ; Thu, 6 Jul 2006 18:51:33 +0200 (MET DST) Received: from shiva.jussieu.fr (shiva.jussieu.fr [134.157.0.129]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k66GpXoP013926 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 6 Jul 2006 18:51:33 +0200 Received: from hydrogene.pps.jussieu.fr (hydrogene.pps.jussieu.fr [134.157.168.1]) by shiva.jussieu.fr (8.13.6/jtpda-5.4) with ESMTP id k66GpN0h002996 ; Thu, 6 Jul 2006 18:51:23 +0200 (CEST) X-Ids: 165 Received: from strontium (strontium.pps.jussieu.fr [134.157.168.38]) by hydrogene.pps.jussieu.fr (8.13.4/jtpda-5.4) with ESMTP id k66GpHKo027462 ; Thu, 6 Jul 2006 18:51:17 +0200 Received: from vouillon by strontium with local (Exim 4.60) (envelope-from ) id 1FyX4U-00017Q-0l; Thu, 06 Jul 2006 18:51:22 +0200 Date: Thu, 6 Jul 2006 18:51:21 +0200 To: Matt Gushee Cc: caml-list@inria.fr Subject: Re: [Caml-list] LablGTK app maxes out CPU Message-ID: <20060706165121.GA4165@strontium.pps.jussieu.fr> References: <44AAB3B3.6000807@gushee.net> <20060704191216.GA15888@localhost> <44AAC8EE.1060805@gushee.net> <20060704202117.GB15987@localhost> <44AC4A46.3070105@gushee.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44AC4A46.3070105@gushee.net> User-Agent: Mutt/1.5.11+cvs20060126 From: Jerome Vouillon X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.0.2 (shiva.jussieu.fr [134.157.0.165]); Thu, 06 Jul 2006 18:51:27 +0200 (CEST) X-Virus-Scanned: ClamAV 0.88.2/1586/Wed Jul 5 21:22:07 2006 on shiva.jussieu.fr X-Virus-Status: Clean X-j-bayes: Bayes filter score (experimental) : 0.152 XXX X-Miltered: at nez-perce with ID 44AD3F96.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44AD3F95.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 44AD3F8B.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lablgtk:01 vouillon:01 vouillon:01 non-blocking:01 strace:01 2006:98 continuously:98 wrote:01 caml-list:01 jerome:01 jerome:01 pps:01 jussieu:01 seems:03 jul:04 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 On Wed, Jul 05, 2006 at 05:24:54PM -0600, Matt Gushee wrote: [...] > Thanks for the tip. This does indeed eliminate the errors with a > non-blocking channel. But I still get excessive CPU usage. I have also > tried setting the priority on add_watch (both `DEFAULT_IDLE and `LOW). > Nothing seems to make any difference. It's true that my app does allow > other programs to grab a significant amount of CPU time when they need > it. But when my app is idle and not much else is running, 'top' shows it > using over 90% of the CPU. That's certainly not normal, and I would > think very undesirable. You should try to run your program with the strace program, which traces system calls. This will tell you why your program runs continuously rather than waiting for I/Os. -- Jerome