comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » RE: Widgets break CALL_EXT?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
RE: Widgets break CALL_EXT? [message #5728] Fri, 02 February 1996 00:00
mallozzi is currently offline  mallozzi
Messages: 60
Registered: August 1994
Member
> Your problem may be due to IDL's use of unix signals. I ran into a problem
> using CALL_EXTERNAL to perform network i/o. IDL uses signals for a variety
> of tasks. In particular, SIGALRM is used for all timing events. When
> X-windows is used, this timer is set to go off on a regular basis. What
> seems to happen is that if a system call (such as i/o) is done and is
> interrupted by SIGALRM, then the system call will not complete.
-SNIP-

Much thanks to Ken Knighton <knighton@gav.gat.com> for the key to the
solution to this problem. Sure enough, I wrote two little c subroutines
to block SIGALRM and then restore the default state of the handler after
CALL_EXTERNAL was finished, and presto!, everything worked :-)
In my opinion, this behavior is a bug under IDL widgets, and should be
fixed in a future IDL release. Thanks again, Ken

-Bob Mallozzi <mallozzi@ssl.msfc.nasa.gov>
Re: Widgets break CALL_EXT? [message #5739 is a reply to message #5728] Thu, 01 February 1996 00:00 Go to previous message
Ken Knighton is currently offline  Ken Knighton
Messages: 44
Registered: May 1995
Member
mallozzi@ssl.msfc.nasa.gov wrote:
> Hi all,
>
> I believe that there is a problem with CALL_EXTERNAL under some operating
> systems. For a FORTRAN subroutine that requires termial I/O, an error is
> generated if a widget is created before the call to CALL_EXTERNAL. The READ
> statement in the FORTRAN subroutine generates an error. However, if no widgets
> are used, the call succeeds. I did not test with a C routine, but would be
> interested to see if it produces the same error.
>
Your problem may be due to IDL's use of unix signals. I ran into a problem
using CALL_EXTERNAL to perform network i/o. IDL uses signals for a variety of
tasks. In particular, SIGALRM is used for all timing events. When X-windows
is used, this timer is set to go off on a regular basis. What seems to happen
is that if a system call (such as i/o) is done and is interrupted by SIGALRM,
then the system call will not complete. This can cause all sorts of strange
things to happen to your fortran or C code. I got around this problem by
using the sigblock() system call to block the delivery of SIGALRM while my
i/o was completing and then to unblock the signal (HPUX).

The IDL Advanced Development Guide addresses this problem in chapter 10. It
also documents the IDL_TimerBlock() function call (a C function), that will
accomplish the same thing (and probably takes care of other problems) in a
platform independent way.

I hope this helps.

Ken Knighton knighton@gav.gat.com knighton@cts.com
General Atomics
San Diego CA
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Multiple cursors
Next Topic: Re: LUNs and plot

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:02:40 PDT 2025

Total time taken to generate the page: 0.48306 seconds