C++ Logo

SG12

Advanced search

Subject: Re: [ub] C provenance semantics proposal
From: Gabriel Dos Reis (gdr_at_[hidden])
Date: 2019-04-11 10:35:20




On Apr 11, 2019, at 6:35 AM, charleyb123 <charleyb123_at_[hidden]<mailto:charleyb123_at_[hidden]>> wrote:

>> It seems odd to desire support for equality comparisons, but not
>> relational ones.
>
> Why would that be odd? Relational comparison is much more complex, it
> assumes a totally ordered address space. Not all architecture have
> that naturally.

So, let's talk about segmented 16-bit mode of Intel 8086, where
an object is at most 64 KB (one segment).

Arthur O'Dwyer respondeth:
Intel still has a completely linear address-space; it just represents those addresses in a weird redundant way at the bit level.

When we talk about an address-space that is not "totally ordered," I picture an address space something like what Cerberus displays graphically: it's just a bunch of boxes floating in space, some of which are guaranteed to be vertically contiguous (that is, ordered) and some of which aren't.
Does my mental model correspond to some real-world heterogeneous/distributed/associative memory that actually exists, or will exist in the next 40 years? I honestly don't know. But the "bunch of boxes floating in space" addressing model is really easy to imagine and draw on a whiteboard, so I think I understand why it's the model that C and C++ use.

I think the non-linear, disjointed address space is increasing with heterogeneous computing, and will continue to do so.

Current device drivers for CPU/GPU and other "local" compute devices provide a mechanism to "map" the (separate) address-spaces for the several local devices into the host memory address space to hide this issue (presenting an illusion of universal host-linear address space). But, that is only workable "to-a-point". We already deal with "host-visible" and "host-non-visible" device memory for local devices that make this linear-mapping-to-host somewhat problematic.

+1.

I urge caution against arguments I see here and there “oh but the box under my desk is an Intel architecture that has linear address space. Have you seen anything else in the Real World?”.


And, distributed nodes fundamentally *cannot* share an address space, nor map to a host linear address space. Of course, for distributed address spaces we have other mechanisms (content-hashing to an identifier like a UUID, or semantic handles that behave as pointers to include comparison or relational ordering).

Mostly, I'm hoping that address compare-or-relational operations for the language are sufficiently rich that algorithms can be authored that happen to accept in their stead my "fancy pointer" that happens to support these rich relational operations. If only equality is supported, that's fine, I'll probably just write different algorithms that use the "fancy pointer" that happens to support the richer relational form.

--charley

_______________________________________________
ub mailing list
ub_at_[hidden]<mailto:ub_at_[hidden]>
https://nam06.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.open-std.org%2Fmailman%2Flistinfo%2Fub&amp;data=02%7C01%7Cgdr%40microsoft.com%7C0662ba8693e94c96f8b108d6be828ebd%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636905865284903488&amp;sdata=32%2Fyz%2Budl1og4fYR2KqY%2FEqQ8wXWD2YnO1gkPBza3hs%3D&amp;reserved=0



SG12 list run by sg12-owner@lists.isocpp.org