From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 102b75,28b0249f7691568e X-Google-Attributes: gid102b75,public X-Google-Thread: 1164f8,28b0249f7691568e X-Google-Attributes: gid1164f8,public From: zalman@netcom.com (Zalman Stern) Subject: Re: Alpha in peril? First Canion, now Pfieffer (I do think so) Date: 1999/05/12 Message-ID: #1/1 X-Deja-AN: 477092200 Sender: zalman@netcom15.netcom.com References: <371AD875.407C6B83@igs.net> <7g4tng$5ue$1@nnrp1.dejanews.com> <7h7vnn$2ts$15@nntp.Stanford.EDU> <5l4sljqx5d.fsf@tequila.cs.yale.edu> <926495090.942894@haldjas.folklore.ee> <37396C9A.BD7A1D3B@hda.hydro.com> <926518491.202473@haldjas.folklore.ee> <37399C90.7829@hda.hydro.com> Organization: Netcom Followup-To: comp.arch,comp.sys.dec Newsgroups: comp.arch,comp.sys.dec Terje Mathisen (Terje.Mathisen@hda.hydro.com) wrote: : Sander Vesik wrote: : > Searching in a linked list would be: : > : > while (k != SHARED_NULL) : > { : > if (k->data != item) : > k=(struct xyz*)((char *)(k->next) + seg_base); : I believe most programmers will agree that the line above is a _lot_ : more likely to cause bugs than a (type-safe) : k = k->next; Imagine a function that is accessing objects in two different shared segments. (After all, we want at least moderately fine grained sharing right?) In which case, that seg_base global no longer works. You need N of them and some way to manage them, etc. The PL/I mavens know the problem well. (PL/i allowed static declarations associating bases with pointers. I am told it was common enough for bugs to creep in by getting the base association for a pointer wrong.) But the worse problem is that if you had a standard library routine to search a linked list, you could not use it given the above. Compiler support cannot easily solve this as base address management will have to be known to the compiler. Also, it is doubtful that people will accept the performance hit readily enough to compile all code this way. -Z-