Path: utzoo!mnetor!uunet!husc6!cmcl2!nrl-cmf!ames!ucsd!sdcsvax!ucsdhub!hp-sdd!hplabs!decwrl!labrea!polya!ali From: ali@polya.STANFORD.EDU (Ali Ozer) Newsgroups: comp.sys.amiga Subject: Re: IPC - A proposal Message-ID: <2123@polya.STANFORD.EDU> Date: 9 Mar 88 02:51:48 GMT References: <5375@well.UUCP> <739@nuchat.UUCP> <7455@agate.BERKELEY.EDU> <2116@polya.STANFORD.EDU> <44626@sun.uucp> Reply-To: ali@polya.UUCP (Ali Ozer) Organization: Stanford University Lines: 23 In article <44626@sun.uucp> cmcmanis@sun.UUCP (Chuck McManis) writes: >Hmmm, the problem everyone is complaining about is the speed of doing >a FindPort() which takes to long. Maybe what we need instead is a >way of checking to see that a port we originally got was still valid ... >Note that the NewDeletePort() would scribble on the port in some way to make >it appear invalid (nulling out the memory would be sufficient) >... this rule then A) it is fast (IsValidPort could be as simple >as port.mn_Type == NT_MESSAGE) and B) it is reasonably safe from race >conditions. What if that same chunk of memory gets allocated as a port as soon as it's closed? A low probability, but possible... Or some byte gets put in that makes the chunk look like a port? You might need to check that the port type in NT_MESSAGE, and then also probably check that the name is still the same. That'd still beat searching through all the ports. You'd need IsStillValid (port, name). Ali Ozer, ali@polya.stanford.edu ps. BTW, got just got SDB, and it's neat! A bug that I spent half an hour the day before took 10 seconds to find after I started SDB. There it was: "Divide by zero error". Where I would never have found it. Wow!