XForms: Re: fl_do_forms() and signals

Mark Lee (mlee@heartlab.rri.on.ca)
Tue, 16 Feb 1999 17:46:30 -0500

# To subscribers of the xforms list from Mark Lee <mlee@heartlab.rri.on.ca> :

Hi Martin:

I was going through the xform archives and found your article on forms and
signals. I have a similar problem and I thought you can give some advice
on how you got your program working.

Basically I have my main form and a few sub forms which are display status
and update buttons and input fields - all these are controlled by the
initial call to fl_do_forms. In the program a new thread (using sproc a
version of fork) is executed (a long computational loop) and does a few
updates to the other forms. I have tried passing the update information
using a direct signal call - i.e. the signal is raised everytime a update
is needed.

sigset(SIGUSR1,my_handler);

Set the user signal interrupt to my_handler and raise(SIGUSR1) everytime a
update is required. But the X-server still gives me async errors during
updates. So the next step was to use:

fl_add_signal_callback(SIGUSR1,my_handler,0);

but the problem here is that, the callback does not always finish that is
it does not return from my_handler and just hangs the program. So using
your example I first set the signal directly

sigset(SIGUSR1,pass_to_forms);
fl_app_signal_direct(1);
fl_add_signal_callback(SIGUSR1,my_handler,0);

where
void pass_to_forms(int signum, void *data)
{
fl_signal_caught(SIGUSR1);
}

but the same thing happens, my_handler does not always return and the
program hangs.

Is there a way to block the other process until the my_handler function
is finished executing or am I missing so flags I should set in sigaction
or sigpromask.

Thanks
Mark

(I'm on a SGI machine running IRIX 5.3).

__
________/\ \ __ Mark K. Lee "There is thin line between
/\ __ __ \ \/\_\ mlee@irus.rri.uwo.ca Genuis and Insanity and
\ \ \ \ \ \ \/ / / Advanced Imaging Group I'm stuck in a singularity"
\ \ \ \ \ \_\/ / Robarts Research Institute
\/_/\/_/\/___/ London, Ontario Canada

_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuhs.mil or see
http://bob.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuhs.mil/mailserv/list-archives/