MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <17183.22650.123383.544421 at karryall.dnsalias.org> Date: Wed, 7 Sep 2005 23:15:38 +0200 From: Olivier Andrieu To: matthieu.dubuget at laposte.net Cc: lablgtk at math.nagoya-u.ac.jp Subject: Re: Timeout (windows/linux comparison) In-Reply-To: <431D8AA6.20102 at laposte.net> References: <431D8AA6.20102 at laposte.net> Matthieu Dubuget [Tuesday 6 September 2005] : > > I'm trying to draw fast curves on screen using a drawing area from > lablgtk2. I experienced very low frequencies under windows. > > I did a very small (and dirty) program, and ran it in bytecode > version on windows and linux in order to understand better my > problem. > > It appears that on windows : > - the timeout is different from the expected one > - there is a maximum (at about 60 Hz) of the frequency at which I can > have a timeout work. > > The program just increments an int ref inside the timeout function, > and prints the frequency obtained when the program stops. Mind that the Timeout thing in the glib main loop is not really meant to be precise. Other events in the queue with higher priority will always be processed first. Check the glib manual for details, here's an excerpt: ,---- | Note that timeout functions may be delayed, due to the processing of | other event sources. Thus they should not be relied on for precise | timing. After each call to the timeout function, the time of the next | timeout is recalculated based on the current time and the given | interval (it does not try to 'catch up' time lost in delays). `---- > I do not know if this is due to the windows implementation of the > gimp library managing this part or if the results on windows can be > improved by modifying some setting? > > This surely is not one lablgtk problem, Maybe it is: did you try the equivalent C program ? > but maybe, someone here has an idea? Not me. -- Olivier