Subject: Re: Nonblocking functions and handlers.

From: [email-masked] (Harry Berryman)
Date: Wed, 25 Nov 1992 11:02:30 -0500

Peter Rigsbee says:

   - first, like most signal handling, this kind of capability tends
     to be more oriented towards C programs and away from Fortran
     programs (note that your prototype for "handler" is such that
     it could not be programmed in Fortran)

Although the prototype given by Greenberg precludes the use of 
Fortran, the approach certainly does not preclude Fortran. 
Obviously Fortran can pass pointers to functions as parameters. 
In particular, the iPSC series (including the Delta) support
a similar mechanism in Fortran through the hrecv(), et al.

-scott berryman
Yale Computer Science Department

---

From: [email-masked] (Peter Rigsbee)
Date: Wed, 25 Nov 92 10:22:26 CST

> Obviously Fortran can pass pointers to functions as parameters. 

Point well taken.  But there are two aspects of the interface to consider.  
Fortran passing pointers to functions as parameters is fine.  But a Fortran
programmer might also want to write the handler in Fortran, which would 
then require that the handler's arguments all be pointers to things.  But 
this would bother C programmers and would be inconsistent with other 
"signal handlers".

> a similar mechanism in Fortran through the hrecv(), et al.

My iPSC documentation (which may be out of date) shows that hrecv() can be 
called by Fortran but requires that the handler be written in C:

	proc	is the procedure executed when the receive is complete.
		This procedure must be written by the user and must be a
		C procedure with four arguments.

I'd argue that having to write the handler in C makes this less useful
to Fortran programmers, especially if you are trying to write something 
portable.  There is no real standard defining how C and Fortran interact.  
The C handler could call a subhandler written in Fortran, but this is getting
kind of messy for something that should be simple.

	- Peter Rigsbee

---

From: Adam Greenberg <[email-masked]>
Date: Wed, 25 Nov 92 13:30:04 EST

Date: Wed, 25 Nov 1992 11:02:30 -0500
   From: [email-masked] (Harry Berryman)

   Peter Rigsbee says:

   -scott berryman

Mea culpa.  The prototype was not meant to exclude Fortran (in fact we through
a discussion of this issue here last week).  The handler should viewed as
taking two pointers:

 void handler( int * msg_id, <type>  * arg )

Sorry for any confusion:
moose