Newsgroups: comp.parallel.pvm
From: ambati@apollo.HP.COM (Ashok Ambati)
Subject: Re: Once more: Signals & PVM
Organization: Hewlett-Packard Company, Chelmsford, MA
Date: Thu, 16 Feb 1995 14:33:12 GMT
Message-ID: <D43KFD.7nB@apollo.hp.com>

In article <3hqbgh$al2@zeus.rbi.informatik.uni-frankfurt.de>, sth@em.informatik.uni-frankfurt.de (Stefan Hoereth) writes:
|> In article al2@zeus.rbi.informatik.uni-frankfurt.de, sth@em.informatik.uni-frankfurt.de (Stefan Hoereth) writes:
|> 
|> > In pvm 3.3.6 and 3.3.7 there is no function call
|> > 'pvm_signal()' (neither in 'pvm3.h' nor in the sources)
|> 
|> Of course not, since the name of the function call is 'pvm_sendsig()'.
|> 
|> I have to excuse for my 'garbage mail' but I was misled
|> by another article.
|> 
|> However, people seem to be undecided whether to use signals with pvm or not.
|> 
|> To my understanding it should be save to:
|>   - use a dedicated user signal (e.g. SIGUSR1 on SUN)
|>   - mask this signal before every call to a pvm routine.
|> (Is the latter really necessary?)
|> 
|> Could someone shed light on this ?
|>
It depends on what the user wants to do in the signal handler. If it is simply
to set a global flag indicating that a signal was received, I don't think it
is necessary to mask the signal before every call to a pvm routine.

On the other hand, if the user wants to make calls to PVM routines from within
the signal handler, it is better to mask the signal in the user code before 
calling any PVM routines. This is because the PVM code is not re-entrant.

Another problem is calling user routines or routines in some library from the
signal handler that are callable from the user code too. These routines either
have to be re-entrant or should be called from user code only after masking the
signal.

All the above sounds pretty complicated, but is unfortunately unavoidable.

Hope this is of some help in understanding how to code for asynchronous receives.

Ashok Ambati. 


