Re: XForms: Question on Idle Callback and Delta Value

Steve Lamont (spl@szechuan.ucsd.edu)
Tue, 19 Jan 99 14:58:33 PST

# 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/