From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX"  8-JUN-1991 19:29:03.50
To:	ARISIA::EVERHART
CC:	
Subj:	Re: Mailboxes.

From:	RELAY-INFO-VAX@CRVAX.SRI.COM@SMTP@CRDGW2
To:	Everhart@Arisia@MRGATE

Received:  by crdgw1.ge.com (5.57/GE 1.99)
	 id AA18887; Sat, 8 Jun 91 19:13:32 EDT
Received: From ucbvax.Berkeley.EDU ([128.32.133.1]) by CRVAX.SRI.COM with TCP; Fri,  7 JUN 91 18:59:40 PDT
Received: by ucbvax.Berkeley.EDU (5.63/1.42)
	id AA11165; Fri, 7 Jun 91 18:48:35 -0700
Received: from USENET by ucbvax.Berkeley.EDU with netnews
	for info-vax@kl.sri.com (info-vax@kl.sri.com)
	(contact usenet@ucbvax.Berkeley.EDU if you have questions)
Date: 8 Jun 91 01:47:45 GMT
From: cis.ohio-state.edu!magnus.acs.ohio-state.edu!zardoz.eng.ohio-state.edu!kcgl1.eng.ohio-state.edu!JONESD@ucbvax.Berkeley.EDU  (David Jones)
Organization: The Ohio State University
Subject: Re: Mailboxes.
Message-Id: <1991Jun8.014745.15398@zardoz.eng.ohio-state.edu>
References: <1636@seq.uncwil.edu>, <1991Jun7.202506.3635@rock.concert.net>
Sender: info-vax-request@kl.sri.com
To: info-vax@kl.sri.com

Path: zardoz.eng.ohio-state.edu!magnus.acs.ohio-state.edu!zaphod.mps.ohio-state.edu!wuarchive!uunet!europa.asd.contel.com!gatech!mcnc!rock.concert.net!ralph!rbn
From:
Newsgroups: comp.os.vms
Subject: Re: Mailboxes.
Date: 7 Jun 91 20:25:06 GMT
References: <1636@seq.uncwil.edu>
Sender: news@rock.concert.net
Organization: MCNC Center for Communications
Lines: 18

In message <1991Jun7.202506.3635@rock.concert.net>, rbn@ralph.uucp writes:
>Ther is a way to create a mailbox with DCL -- I saw a copy of it not
>long ago -- it involves a trick with SPAWN.  The spawned subprocess is
>the vehicle for creating the mailbox.  The parent process opens the mailbox
>explicitly after creating the child -- the child must wait around until
>the parent is ready.  The synch can be done with a logical name in the
>job table.

I wrote the command procedure below about a year ago.  Synchronization is done
with ATTACH, a job logical name is used to communicate the PID of the spawned
process back to the parent.
-------------------------------------------------------------------------------
$!
$! kludge for creating mailbox from DCL.  Parameters:
$!	P1 - logical name to open channel with.
$!	P2 - logical name to assign to mailbox.
$!
$ IF P3 .EQS. ""
$ THEN
$!    Master side.
$     proc = f$environment("PROCEDURE")
$     SPAWN/NOLOG @'proc' 'P1' 'P2' "SUB"
$     pid = f$trnlnm("MBX_PROCESS")
$     open/read/write 'P1' DCL$ATTACH_'pid'
$     define/job 'P2' 'f$trnlnm(P1)
$     ATTACH /ID='pid'
$ ELSE
$!    child side
$     DEFINE/JOB MBX_PROCESS 'F$GETJPI("0","PID")
$     ATTACH /ID='F$GETJPI("0","OWNER")
$     DEASSIGN/JOB MBX_PROCESS
$     EOJ
$ ENDIF

David L. Jones               |      Phone:    (614) 292-6929
Ohio State Unviversity       |      Internet:
1971 Neil Ave. Rm. 406       |               jonesd@kcgl1.eng.ohio-state.edu
Columbus, OH 43210           |               jones-d@eng.ohio-state.edu

Disclaimer: A repudiation of a claim.

