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: Sander Vesik Subject: Re: Alpha in peril? First Canion, now Pfieffer (I do think so) Date: 1999/05/12 Message-ID: <926518491.202473@haldjas.folklore.ee>#1/1 X-Deja-AN: 477016866 Cache-Post-Path: haldjas.folklore.ee!unknown@localhost.folklore.ee Content-Transfer-Encoding: 8bit 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> Content-Type: text/plain; charset=US-ASCII X-Complaints-To: usenet@news.ut.ee X-Trace: kadri.ut.ee 926518490 7767 193.40.6.121 (12 May 1999 14:14:50 GMT) Organization: ERA/EKI FO X-Cache: nntpcache 2.3.2 (see http://www.nntpcache.org/) Mime-Version: 1.0 NNTP-Posting-Date: 12 May 1999 14:14:50 GMT Newsgroups: comp.arch,comp.sys.dec In comp.arch Terje Mathisen wrote: > Sander Vesik wrote: > > > > In comp.arch "Stefan Monnier " wrote: > > > Furthermore, pointers can now be exchanged between processes in a meaningful > > > manner. SHM segments are now always mapped at the same address in each process > > > which allows the use of actual data-structures in there. > > > > You can use actual data structures in shared memory even now (at least in > > mmap shared memory). You just have to use offsets relative to the start > > of the shared region instead of an absolute address. > > > > Considering the cost of following a pointer, the cost of one addition to > > get the pointer which to follow is so insignificant as to not be worth > > mentioning. > This is right and wrong: > Yes, since even the PII/PII which has a very short load-to-use latency > needs 3 cycles per pointer to follow a chain (in L1 cache), the extra > addition can never add more than 33% to the running time, and as long as > you're actually doing something with the pointers, much less. > OTOH, it makes it much harder to write error-free high-level code that > uses these data structures, languages which simply don't allow direct > access to pointers need not apply at all. Why harder? You just have to add one addition in there everywhere. Searching in a linked list would be: while (k != SHARED_NULL) { if (k->data != item) k=(struct xyz*)((char *)(k->next) + seg_base); } instead of while (k != NULL) { if ((k->data) != item) k=k->next; } > (Is this true? Can you make based pointers work in Java? What about > Ada?) At least for java, doesn't a "shared segment" require extra support anyways? If a shared segment was just an object that overrided the [] operator (which would be written in some other language) and we were content with having the shared segemnt consist of only an array of object of same type (and size) we suddenly have based pointers (as indexes of the above pseudo-array). > Terje > PS. Of course, coming from an x86 background with near, far, based, huge > and flat addresses, a simple two-part address doesn't look too > intimidating, but it still seems similar to the double-linked list with > a single pointer trick, using XOR'ed prev/next links. > -- > - > Using self-discipline, see http://www.eiffel.com/discipline > "almost all programming can be viewed as an exercise in caching" -- Sander There is no love, no good, no happiness and no future - all these are just illusions.