Remix.run Logo
masfuerte 16 hours ago

But physical memory is a giant flat space of contiguous addresses. Do you mean virtual memory?

assimpleaspossi 6 hours ago | parent | next [-]

I almost questioned the same thing but I think we both know that's what he meant.

customguy 10 hours ago | parent | prev [-]

How could it be? For example, each memory stick doesn't know beforehand what other memory sticks it will be used with, so the "physical" addressing of the memory on each stick has to be independent of the others, i.e. a local address, that gets mapped to a virtual one.

inigyou 2 hours ago | parent | next [-]

This guy is right. Physical memory isn't flat. Every system with more than a few cores is NUMA. There are caches and cache lines. Memory channel interleaving. Ranks and banks and rows. Each DRAM chip keeps the last selected row and can access addresses within that row more quickly even if other accesses to other chips occur in the middle, unless a refresh cycle occurs.

It's all a layer below even OS programming. It's configured at the BIOS level and then performed in hardware. But that's the point, isn't it? Virtual memory is below the application programmer, too, but here we're chastising him for not understanding it. If we do that, shouldn't we equally chastise people for not understanding physical memory? Or speculative execution? Or head seeking and servo tracks? Or Ethernet line coding?

hvb2 9 hours ago | parent | prev [-]

But that's not relevant? What would be relevant if, depending on where your bits are stored, acces time is significantly slower. If, regardless of where my data goes, my access time is constant then I do not care as a dev?

That's the abstraction I'm working with when coding. Which is necessary because in most cases this should be an implementation detail.

customguy 20 minutes ago | parent [-]

Really not caring about something also means not making a positive and false claim about it. What I said was relevant to that claim. That claim in turn was, according to your heuristics, not relevant (for daily coding).