From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1164f8,28b0249f7691568e X-Google-Attributes: gid1164f8,public X-Google-Thread: 102b75,28b0249f7691568e X-Google-Attributes: gid102b75,public From: Sander Vesik Subject: Re: Alpha in peril? First Canion, now Pfieffer (I do think so) Date: 1999/05/13 Message-ID: <926611253.423074@haldjas.folklore.ee>#1/1 X-Deja-AN: 477459777 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> <926518491.202473@haldjas.folklore.ee> <37399C90.7829@hda.hydro.com> <926580448.540785@haldjas.folklore.ee> <373ABF06.334D@hda.hydro.com> Content-Type: text/plain; charset=US-ASCII X-Complaints-To: usenet@news.ut.ee X-Trace: kadri.ut.ee 926611251 23790 193.40.6.121 (13 May 1999 16:00:51 GMT) Organization: ERA/EKI FO X-Cache: nntpcache 2.3.2 (see http://www.nntpcache.org/) Mime-Version: 1.0 NNTP-Posting-Date: 13 May 1999 16:00:51 GMT Newsgroups: comp.arch,comp.sys.dec In comp.arch Terje Mathisen wrote: > Sander Vesik wrote: > > > > In comp.arch Terje Mathisen wrote: > > > I considered that option, but it would require that all the possible > > > base addresses must be an integral multiple of the object size, which > > > would pretty much limit this approach to a small set of powers-of-two > > > object sizes. > > > > How come? Most things in this world live pretty well with getting > > page aligned (is there really anything that gives you non-page aligned > > shared memory for something bigger than one page?) memory. > > > > Any kind of shared memory will most probably be page aligned. > Agreed. > The problem is if I allocate an array of objects, where the object size > is relatively prime to 2, there is no way to access it from a different > base address with a simple base_index offset. > I.e. if I define > // Assume 32-bit pointers, so the record size will be 12 bytes > typedef struct _r { struct _r *next; struct _r *prev; float data; } r; > and then go on to allocate an array of these, where the pointers define > some internal order within the array > r a[SIZE] > then a second process which shares this buffer but mapped at a different > base address, can never calculate an index offset which would make the > following work: > p = p->next + base_index; > This follows directly since 12 can never divide a power-of-two page size > (mmap address). Theoretically, you can always demand that the segments were aligned at K*page_size, where K is teh size (with padding) of the structure. But as one may want to store more than one data type per segment, all such schemes are always lacking. > You always end up with the ugly casts back & forth to (char *). Agreed. I'd say it is also about the price I am ready to pay for two unrelated processes to be able to have a shared segment of data that does not have have to be on the same adresses. For in principle it extends nicely to the case where the programs need not even run inside one box, the only thing that is required is coherence. > Terje > -- > - > 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.