caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Matt Gushee <matt@gushee.net>
To: caml-list@inria.fr
Subject: Re: [Caml-list] LablGTK app maxes out CPU
Date: Wed, 05 Jul 2006 20:46:39 -0600	[thread overview]
Message-ID: <44AC798F.90008@gushee.net> (raw)
In-Reply-To: <44AC4A46.3070105@gushee.net>

Matt Gushee wrote:

> 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.
> 
> A 'sleep' call might help, but the standard Unix.sleep only accepts 
> 1-second increments, which is undesirable. But I can try a wrapper for 
> usleep() ... unless someone has a better idea.

Argh! This is getting really frustrating ...

I added a custom sleep function, and called it to sleep for 0.3 seconds 
whenever there is no input to read. That should hugely reduce the 
frequency of attempts to read the FIFO, while not introducing much of a 
delay in response to commands. I tried both implementations, by the way: 
both the usleep wrapper and the Unix.select hack.

It doesn't make any difference.

BTW, I did check the app in non-daemon mode, and CPU usage is quite 
modest, as I would expect. And the only real difference between normal 
and daemon mode is this Io watching thing.

-- 
Matt Gushee
: Bantam - lightweight file manager : matt.gushee.net/software/bantam/ :
: RASCL's A Simple Configuration Language :     matt.gushee.net/rascl/ :


  parent reply	other threads:[~2006-07-06  7:17 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-04 18:30 Matt Gushee
2006-07-04 18:59 ` [Caml-list] " Matt Gushee
2006-07-04 19:12 ` Eric Cooper
2006-07-04 20:00   ` Matt Gushee
2006-07-04 20:21     ` Eric Cooper
2006-07-05 23:24       ` Matt Gushee
     [not found]         ` <Pine.LNX.4.64.0607060354120.6166@home.oyster.ru>
2006-07-06  0:27           ` Matt Gushee
2006-07-06  2:46         ` Matt Gushee [this message]
2006-07-06 16:51         ` Jerome Vouillon
2006-07-06 19:16           ` Matt Gushee
2006-07-06 23:51           ` Matt Gushee
2006-07-07  1:26             ` SOLVED -- " Matt Gushee
2006-07-07 13:40             ` Jerome Vouillon

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=44AC798F.90008@gushee.net \
    --to=matt@gushee.net \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).