English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
A small footprint GUI for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-05-27 (14:53)
From: Eric Cooper <ecc@c...>
Subject: Re: [Caml-list] A small footprint GUI for OCaml
On Sat, May 26, 2007 at 03:09:43PM -0700, Alexsandro Soares wrote:
> My collaborators and I wrote a small footprint graphics.cmxa based
> GUI for OCaml.  It works well on Windows, but not so well on
> Linux. In fact, in most Linux installations the program turns out to
> be unbearably slow; to make it usable, I am forced to use powerful
> and well tuned video cards.

I tried your program briefly and noticed (using a load monitor) that
it was constantly using CPU cycles even when it should be idle.  So I
ran it under "strace" and saw that it was continually reading data
from the connection to the X server.  This occurs inside a signal
action, probably triggered by a timer interrupt.

Compare that to a real Emacs process, which is almost always in a
blocking select() system call when idle.

I haven't looked at your source code, or the Graphics implementation,
but I conclude that you need to find a way to block, rather than poll,
for input events.

Eric Cooper             e c c @ c m u . e d u