Re: xforms 0.81 on AIX V3.2.5

Erwin Burgstaller (ber@knapp.co.at)
Fri, 28 Feb 1997 12:49:52 +0100 (MET)

To subscribers of the xforms list from Erwin Burgstaller <ber@knapp.co.at> :

On Fri, 28 Feb 1997, Orlando Andico wrote:

>Dumb solution: place a little sleep() immediately after the
>fl_check_forms() call in LyX. I haven't really dug into LyX myself but I
>think what's happening is that LyX is polling (fl_check_forms() is the
>nonblocking check). So you have something like:
>
> FL_OBJECT *ret;
>
> ret = fl_check_forms ();
>
> if (ret == Button1) DoThis;
> else
> if (ret == Button2) DoThat;
> else ...
> sleep (1);
>

Thanks for the tip. I've done it that way, although lyx doesn't handle it
like above. It reduces the processor time from 15% to 1.2% while doing
nothing, which is an improvement but not perfect for a process which should
be complete idle.

So, isn't it possible to have an idle wait with Xforms??

For those, who're having the same problem (and there's only sleep()
available):

......

#include <sys/types.h>
#include <sys/times.h>
#include <sys/select.h>

long nap ( long naptime )
{
struct timeval tv;

tv.tv_sec = naptime /1000;
tv.tv_usec = (naptime % 1000) * 1000;

select(0, NULL, NULL, NULL, &tv);
return (naptime);
}

.....

main()
{
......
while (true) {
if (fl_check_forms() == FL_EVENT){
fprintf(stderr, "LyX: This shouldn't happen....\n");
fl_XNextEvent(&ev);
}
nap(100);
}
......
}

There's no processing here in this while loop, seems to work with
callback's.

Erwin

_________________________________________________
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/xforms-archive/