RE: XForms: Question on Idle Callback and Delta Value

Chip Sutton (chip@cs-net.com)
Tue, 19 Jan 1999 23:17:13 -0500

# To subscribers of the xforms list from "Chip Sutton" <chip@cs-net.com> :

One thing I tried after I posted my original message. I added a write to a
file with the current time value in the idle callback and changed the delta
value to 2000. Most of the time the idle callback executed once every two
seconds, but occasionally it is called about 10 times within 1 second.
Maybe this somehow relates to what I am seeing with the occasional button
delay, although I did not get to the point of trying to relate the timing of
the button push and the stream of callback executions.

The situation is certainly not intolerable, I mainly wanted to make sure I
wasn't misunderstanding something with the idle callback and delta value.

The difference in CPU between the idle callback and the timeout is not
significant. Using top on HP-UX the idle callback (with a delta value of
1000) drops down to around 0.1% and using the timeout it drops below 0.4%.
I thought that perhaps that some of the additional CPU was related to the
fact that the timeout was removed at expiration and then has to be
reestablished in the callback. My concern with the number of users is more
related to the other HP Openview processes that are running on the same
server and not the browser process. Since I have some control over my own
processes and very little control over the HP Openview processes I wanted to
have mine be as efficient as possible. (Or maybe its just a personal hangup
about not wanting to see my processes in the top 10 when someone runs top
:-).

Thanks for the reply.

Chip

> -----Original Message-----
> From: owner-xforms@bob.usuf2.usuhs.mil
> [mailto:owner-xforms@bob.usuf2.usuhs.mil]On Behalf Of Steve Lamont
> Sent: Tuesday, January 19, 1999 5:59 PM
> To: xforms@bob.usuf2.usuhs.mil
> Subject: Re: XForms: Question on Idle Callback and Delta Value
>
>
> # To subscribers of the xforms list from spl@szechuan.ucsd.edu
> (Steve Lamont) :
>
> > I have a program that implements a browser to display event information.
> > Event information is sent to the program from another process
> using an IPC
> > Message Queue. I am using an idle callback to check to see if there is
> > anything on the queue for this process. I am using the
> fl_set_idle_delta
> > function(long msec)where msec is 1000. My assumption is that
> assuming no
> > other events that my idle callback will get invoked
> approximately once each
> > second. This is working as I expect.
> >
> > The one thing I have noticed when using the delta value is when
> "pushing"
> > some buttons on the form it occasionally takes about 1 second
> for the event
> > to register, but not always. I do not ever see this occasional
> delay if I
> > don't set the idle delta value.
>
> My guess is that there's a race condition somewhere in the XForms
> event loop where the button press occurs in the interstices between
> the idle callback and the select() buried deep within the Xlib event
> handling code such that the event gets posted but not acted upon
> before XForms drops into its own select() call that watches for I/O
> and/or event loop timeouts. I'm not sure if there is a Right Way to
> do this.
>
> > Instead of the idle callback I tried
> fl_add_timeout(1000,callback_name,0) to
> > perform the queue check once each second. This worked fine and
> I did not
> > see the occasional "delay" when pushing form buttons. The one
> thing I did
> > notice was that using the idle callback with a idle delta set
> at 1000 msecs
> > used quite bit less CPU than the timeout over time. Since many
> users may be
> > running this program to view events I am want to use the option
> that uses
> > the least CPU.
>
> My guess is that this is because the XForms event loop is running more
> frequently, thus consuming more time.
>
> Is the CPU use significantly greater? How many users do you expect to
> have the application running at any one time? It seems to me that if
> this is going to bog down your system you may have too many users on
> it to start with. :-)
>
> spl
>
> _________________________________________________
> To unsubscribe, send the message "unsubscribe" to
> xforms-request@bob.usuf2.usuhs.mil or see
> http://bob.usuf2.usuhs.mil/mailserv/xforms.html
> XForms Home Page: http://bragg.phys.uwm.edu/xforms
> List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/
>
>

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/