Bartosz Milewski Missing post

Michel Fortin michel.fortin at michelf.com
Sat May 30 05:24:59 PDT 2009


On 2009-05-28 12:52:06 -0400, Andrei Alexandrescu 
<SeeWebsiteForEmail at erdani.org> said:

> What happens is that memory is less shared as cache hierarchies go 
> deeper. It was a great model when there were a couple of processors 
> hitting on the same memory because it was close to reality. Cache 
> hierarchies reveal the hard reality that memory is shared to a 
> decreasing extent and that each processor would rather deal with its 
> own memory. Incidentally, message-passing-style protocols are prevalent 
> in such architectures even at low level. It follows that message 
> passing is not only an attractive model for programming at large, but 
> also a model that's closer to machine than memory sharing.

While message-passing might be useful for some applications, I have a 
hard time seeing how it could work for others. Try split processing of 
a 4 Gb array over 4 processors, or implement multi-threaded access to 
an in-memory database. Message passing by copying all the data might 
happen at the very low-level, but shared memory is more the right 
abstraction for these cases.

There's a reason why various operating systems support shared memory 
between different processes: sometime it's easier to deal with shared 
memory than messaging, even with all the data races you have to deal 
with.

Shared memory becoming more and more implemented as message passing at 
the very low level might indicate that some uses of shared memory will 
migrate to message passing at the application level and get some 
performance gains, but I don't think message passing will ever 
completely replace shared memory for dealing with large data sets. It's 
more likely that shared memory will become a scarse resource for some 
systems while it'll continue to grow for others.

That said, I'm no expert in this domain. But I believe D should have 
good support both shared memory and message passing.

I also take note that having a good shared memory model could prove 
very useful when writting on-disk databases or file systems, not just 
RAM-based data structures. You could have objects representing disk 
sectors or file segments, and the language's type system would help you 
handle the locking part of the equation.

-- 
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/




More information about the Digitalmars-d mailing list