[XForms] fl_check_forms (from Matthew Yaconis)

Todd Denniston Todd.Denniston at ssa.crane.navy.mil
Fri Sep 24 12:19:36 EDT 2004


laurent FOURNIER wrote:
> 
> To subscribers of the xforms list
> 
> Dear Matthiew,
> 
> I have developped a graphical client which is supposed to run either on
> OSF/1, Linux and LynxOS. The sources of data are multiple : either data
> comes from the X11 server, or from a "Cm" message via TCP/IP or from a pipe.
> My application was loosing many graphical refreshes or was missing
> messages coming via TCP/IP (we use a comunication library called "Cm")
> from external servers, or missing piped data from forked processes.
> 
> The problems appeared to be directly connected to the select() function.
> This function (as well as poll() which is used inside Xforms) seems not
> to get good results when it is called from many places in the
> application. It is to be noticed that even threads did not give good
> results (I tried to have one thread for each socket).
> 
> The only solution was to "concentrate" all the select() calls into one
> (I had to rewrite the remote command code and not use Xform's one to get
> piped data).
<SNIP>
Yes within an X application, using more than one select call is not good,
because it can block (waiting for your file input and not the xserver) and you
loose the illusion of interactive response.

most X apps use the select of the widget library they are using, with xforms
that is done by calling fl_add_io_callback to add your file io file
descriptor(fd), and fl_remove_io_callback when you no longer want to watch the
fd. For Fournier's app I realize that was difficult/impossible because of the
"Cm" lib, but when possible it is best to do selects using fl_add_io_callback.
In the past when I have been in Fournier's position, I have moved the lib
calls into a small app that communicated with my X app via fifos and
io_callbacked the fifos.

For Yaconis's situation, if you have not already you might want to get
forms.ps.gz from:
ftp://ncmir.ucsd.edu/pub/xforms/DOC
It may be a bit dated[1] but it is an excellent manual on xforms. section 4.2
talks about using fl_check_forms, I am betting Yaconis needs to call
fl_check_forms more often to allow some timer callbacks to work.

[1] unfortunately I cant see anything more from TC about a release of the doc
post this:
http://bob.usuhs.mil/pipermail/xforms/2003/000044.html
maybe it's time to do a pstohtml + html2latex and ask TC to bless the output
for GPL release???
(it's so fine a manual that I would really hate to see us have to start from
scratch on a new one)
http://cgm.cs.mcgill.ca/~luc/PSto.html
http://html2latex.sourceforge.net/
-- 
Todd Denniston
Crane Division, Naval Surface Warfare Center (NSWC Crane) 
Harnessing the Power of Technology for the Warfighter



More information about the Xforms mailing list