[XForms] fl_check_forms (from Matthew Yaconis)

laurent FOURNIER laurent.fournier at lapp.in2p3.fr
Fri Sep 24 05:04:31 EDT 2004


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). Because Cm is not "very open" to external sockets, I had to 
make an adaptation which calls fl_check_forms() from within a hack 
inside the Cm library when the X11 socket is activated. I made the same 
for pipes. Then now my application runs fine and does not loose anymore 
graphical events nor comunication data. In that way, the call to 
select() is inside my main loop and I can process data from every source 
when an event occurs.

I am not sure my explanation is very clear to you, especially because of 
my poor english... The main word to retain would be : have only one call 
to select() in your application for both database exchanges and X11. But 
this is perhaps connected to the OS you are using, too.

Regards,

Laurent.




More information about the Xforms mailing list