[<<] [<] Page 1 of 1 [>] [>>] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Timeouts in nano-X
From: "Amit Kulkarni" ####@####.#### Date: 2 Jan 2001 19:29:19 -0000 Message-Id: <F1547Wg7qOIvQaGdtp20000de95@hotmail.com> hi, Is there any way in which one can receive timeouts based on windows (wids) in nano-X? Or some means by which one can get 2 processes running? the "select" timeout seems to be given as GR_EVENT_TYPE_TIMEOUT When i want to keep timeouts for various windows, or widgets :-) rather then the thing becomes very hard to handle. Any ideas ? Regards, Amit Kulkarni Visit me at http://www.amitkulkarni.com _________________________________________________________________________ Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Subject:
Re: Timeouts in nano-X
From: Alex Holden ####@####.#### Date: 2 Jan 2001 21:30:17 -0000 Message-Id: <Pine.LNX.4.04.10101022112300.612-100000@hyperspace.linuxhacker.org> On Wed, 3 Jan 2001, Amit Kulkarni wrote: > When i want to keep timeouts for various windows, or widgets :-) rather then > the thing becomes very hard to handle. It's not very hard. In the next version of Microwindows, the server will have a generic timer mechanism that I hacked up in a couple of hours (assuming Greg decides to include it- he was making noises about having too much stuff to merge the last time I heard from him). It isn't accessible to clients, but the same method can easily be implemented in a widget set. You need a list of timeout events with expiry callbacks and a couple of utility functions to add and remove them, and then before you enter the select (ie. call GrGetNextEventTimeout()), find the shortest timeout in the list and use that as the select timeout. After the select returns, handle any non timer events, then go through and call the callback functions of all the timers which have expired. If you have to handle more than a few tens of simultaneous timeouts, the events should either be sorted, or ideally arranged in a heap (see my TEA Total code for a public domain implementation of one). The server never has more than two or three simultaneous timeouts though, so I just used a simple linear search for that. -- ------- Alex Holden ------- http://www.linuxhacker.org/ http://www.robogeeks.org/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
[<<] [<] Page 1 of 1 [>] [>>] |