Newsgroups: comp.parallel.pvm
From: ajf2j@uvacs.cs.Virginia.EDU (Adam J Ferrari)
Subject: Re: Is PVM Thread Safe?
Organization: University of Virginia Computer Science Department
Date: Thu, 6 Jul 1995 03:28:43 GMT
Message-ID: <DB9yzw.FoM@murdoch.acc.Virginia.EDU>

> The PVM API has unsafe aspects to it.  
> 
> In pseudo-calls:
> 	Initialize a buffer
> 	Pack
> 	Pack
> 	...
> 	Pack
> 	Send or Mcast
> One needs to know which message a given pack applies to; in the
> thread world, this is not well-defined, unless we restrict ourselves
> to the PVM 2.x model of one message at a time, which is unlikely
> to be your choice.

In the TPVM system which I helped develop, we retained the above
buffer management API style using the following simple solution:

	o pvm_initsend, pvm_pk*, pvm_upk*, are replaced by 
	  equivalent tpvm versions (same type signatures and
	  functionality).

	o The active send and receive buffers are part of 
	  a running thread's "state." The tpvm buffer management
	  routines ensure that operations (e.g. sends, packs, etc.)
	  are applied to the appropriate active buffer for the
	  calling thread.

This simple scheme allows TPVM programs to be written in the same style
as standard PVM 3.x programs where the active send and receive buffers
are part of the implicit task state.

More information about TPVM is available at:
	http://www.cs.virginia.edu/~ajf2j/tpvm.html

---
Adam J. Ferrari
ferrari@virginia.edu

