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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 65440BB83 for ; Fri, 7 Jul 2006 15:40:55 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k67DetrO028027 for ; Fri, 7 Jul 2006 15:40:55 +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 PAA01212 for ; Fri, 7 Jul 2006 15:40:55 +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 k67Desex028019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Fri, 7 Jul 2006 15:40:55 +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 k67Def67016172 ; Fri, 7 Jul 2006 15:40:45 +0200 (CEST) X-Ids: 166 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 k67DeYPg008332 ; Fri, 7 Jul 2006 15:40:34 +0200 Received: from vouillon by strontium with local (Exim 4.60) (envelope-from ) id 1FyqZU-0001du-6Z; Fri, 07 Jul 2006 15:40:40 +0200 Date: Fri, 7 Jul 2006 15:40:40 +0200 To: Matt Gushee Cc: caml-list@inria.fr Subject: Re: [Caml-list] LablGTK app maxes out CPU Message-ID: <20060707134040.GA6203@strontium.pps.jussieu.fr> 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <44ADA1E9.7070106@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.166]); Fri, 07 Jul 2006 15:40:49 +0200 (CEST) X-Virus-Scanned: ClamAV 0.88.2/1587/Thu Jul 6 22:55:48 2006 on shiva.jussieu.fr X-Virus-Status: Clean X-j-bayes: Bayes filter score (experimental) : 0.208 XXXX X-Miltered: at concorde with ID 44AE6467.002 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44AE6466.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at shiva.jussieu.fr with ID 44AE6459.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; lablgtk:01 vouillon:01 vouillon:01 strace:01 gtk:01 2006:98 wrote:01 caml-list:01 jerome:01 jerome:01 pps:01 jussieu:01 span:97 fonts:03 identically: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 On Thu, Jul 06, 2006 at 05:51:05PM -0600, Matt Gushee wrote: > Okay, I've done the strace. I found something that appears to be > significant, but I don't really understand it. After the GUI is > displayed, there are a number of GTK library calls, and then some > searches for various resources--locale files, fonts, icons--and then this: [...] > poll([{fd=3, events=POLLIN}, {fd=7, events=POLLIN, revents=POLLHUP}], 2, > -1) = 1 > > The last two lines are then repeated around 18000 times (identically > each time, as far as I can see), until the 'quit' command is received. > This takes place over a span of perhaps 30 seconds of real time. So > pretty clearly this is the CPU-eating behavior, but I still can't see > what is triggering it. By the way, FD #7 is my FIFO. The POLLHUP events means that the other side of the FIFO has been closed. Thus, you should stop listening on the FIFO. To be portable, you should also stop listening when you receive a POLLIN event but there is nothing to be read. (Mac OS, for instance, returns POLLIN when Linux would return POLLHUP.) -- Jerome