Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!samsung!spool.mu.edu!snorkelwacker.mit.edu!stanford.edu!agate!agate.berkeley.edu!nj From: nj@magnolia.Berkeley.EDU (Narciso Jaramillo) Newsgroups: comp.sys.amiga.programmer Subject: Re: Arexx article in AC Tech Amiga - good but ??? Message-ID: Date: 29 Mar 91 17:32:34 GMT References: <1991Mar27.200758.1432@maytag.waterloo.edu> Sender: usenet@agate.berkeley.edu (USENET Administrator) Organization: Postcarcinogenic Bliss, Inc. Lines: 26 In-Reply-To: giguere@csg.uwaterloo.ca's message of 27 Mar 91 20:07:58 GMT In article <1991Mar27.200758.1432@maytag.waterloo.edu> giguere@csg.uwaterloo.ca (Eric Giguere) writes: > [If you run the same program multiple times, it should create ports > named ., where increases by one for every > new instance of the program.] > Of course, now you have a different problem... if you want to talk to > a text editor, which port name do you use...? Well ARexx scripts usually > don't have to worry because the default host address of an ARexx script > will be set to the correct port by the application that starts it. It's > your own independent scripts that have to worry... In those situations > it may be wise for the application to always open a well-known port for > independent communication. Mg does essentially what you mentioned above--every new invocation of mg creates a different port name. It handles multiple invocation addressing in an interesting way. When you want to talk to an existing mg, you try to address the first possible portname, `mg'. If that exists, you then send it the command `rexx-lock'. If someone else is using that mg, it will fail, and you go on to try the next possible portname, and so on. If no one is using a given copy of mg, `rexx-lock' gives you exclusive control over that mg until you send it the `rexx-unlock' command. nj