Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!spool.mu.edu!munnari.oz.au!bruce!labtam!eyrie!asgard!bart From: bart@asgard.pub.uu.oz.au (John Butcher) Newsgroups: comp.sys.amiga.programmer Subject: Re: Message Ports Message-ID: Date: 31 May 91 20:27:39 GMT Article-I.D.: asgard.b3Eep*8m References: <49659@seismo.CSS.GOV> Distribution: comp Organization: Private Lines: 42 In article <49659@seismo.CSS.GOV>, Mike Black writes: > > > >That solution is kind of gross, but then again I don't think ports > >were meant to hang around after a program exited. Do you really need > >a port that lasts after your program's termination, or was this just > >for the test program? > > > > Ports tie themselves to the invoking task and therefore are definitely > NOT meant to hang around after termination. His program works just > fine if modified slightly so that it hangs around for a while after > creating the port so you can run the program from another window to > try and find it (WITHOUT deleting it). Always let the program that > creates the port delete it. Hmmm, I was directed to some PD source for some handlers ( Sun mouse and click-to-front I think, could be wrong ), which use a message port to store a pointer to some stuff, so when you run it the first time, it creates the port, then subseqent runs find look for the port, and can use it if it's there ( to kill the program ), so the 1st time you run it, it installs the handler, the second time, cos the port is found, it kills it, etc I seem to remember the code using the "task" address to store a pointer to it's own AllocMem()'d data, so is there anything wrong with doing this, it _DOES_ work, I dont know how good the practice is, the question is, is it possible for this sort or program to break, and if so, what are the alternatives ? > Mike... > > -- > ------------------------------------------------------------------------------- > : usenet: black@beno.CSS.GOV : land line: 407-494-5853 : I want a computer: > : real home: Melbourne, FL : home line: 407-242-8619 : that does it all!: > ------------------------------------------------------------------------------- ^^^^^^^^^ Not to be confused with Melbourne Australia, _MY_ real home ;-) ----------------------------------------------------------------------------- John Butcher : bart@asgard.pub.uu.oz.au ..!munnari!eyrie.oz.au!asgard!bart "'Racket'?? That's BRAHMS... BRAHMS' THIRD RACKET!!!" - Basil Fawlty