Newsgroups: comp.parallel.pvm
From: Richard Kilgore <rkilgore@lore.ece.utexas.edu>
Subject: Re: Get a new tid for fork()'ed process?
Organization: The University of Texas at Austin
Date: Tue, 05 Mar 1996 13:26:29 -0600
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Message-ID: <313C9565.33084EE6@lore.ece.utexas.edu>

Jeffrey Martin wrote:
> 
> Richard Kilgore <rkilgore@lore.ece.utexas.edu> wrote:
> 
> > I've got an application in which a process running as a task
> > under pvm calls fork().  My problem is that the child process
> > ends up with the same Pvm task ID as the parent, but I want
> > it to be independent.  Is there some way to kick the Pvm
> > libraries in the back of the head and say, "Hey, I'm a
> > NEW Process!!"?
> 
> Use pvm_spawn instead? (with flag = PvmTaskHost, where = "localhost")

A fork() allows the new task to start with the same program state
as the parent process.  This is quite different from starting a
brand new task with pvm_spawn().

A few people gave me a good answer.  They claim I can use pvm_endtask()
followed by pvm_mytid() in the child process.  My current version (3.3.9)
doesn't seem to have pvm_endtask(), so I'm going to download the
latest and see what happens.

Thanks to those who reponded!

	- rick

P.S:  To those interested:  One of the replies sounded like he had
  actually done this before, but my experiments using pvm_exit() in
  place of pvm_endtask() indicate that you might have to call
  pvm_[exit/endtask]() BEFORE the fork(), and have both the parent
  and child call pvm_mytid() afterward.  If I'm right, it makes the
  process a lot more painful, but still doable.  If anyone wants to
  know the final results of my experiment, e-mail me, so I don't
  have to continue this thread on the public newsgroup.

-- 
Richard B. Kilgore
Grad Student, University of Texas at Austin
WWW URL: http://lore.ece.utexas.edu/~rkilgore/
E-mail rkilgore@lore.ece.utexas.edu

