Re: XForms: how does fl_show_question() do it ?

Steve Lamont (spl@szechuan.ucsd.edu)
Wed, 8 Jul 98 17:51:47 PDT

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> QuitForm is a C++ class containing XForms objects and some flags. The
> relavant ones are int quitnow and int quitcancel.
> When the user wants to quit the program, this routine is invoked:
>
> int quitcmd() {
> [...]
> do
> fl_check_only_forms();
> while(!qf.done);
> [...]
> It works, it's simple, and it doesn't hog the CPU.

Hm. I'm not exactly sure how quitcmd() is invoked but the loop
clearly buzzes. Try doing something like

do {
fprintf( stderr, "." )
fl_check_only_forms();
} while(!qf.done);

and you'll see a string of `.' characters spew out to standard error
until the done flag is asserted true.

Running `top', at least on my system, I can see the load average
immediately go up when I run code similar to that given above. It may
not totally hog the CPU but it definitely sucks cycles.

In any case, either method works.

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/