views:

584

answers:

1

I am learning parallel programming by myself. I wonder if distributed memory is always multiprocess and multithread is always shared memory? if multiprocess can be both for distributed memory and for shared memory? Thanks and regards!

+1  A: 

Yes, yes, and "yes, in a sense"

In a distributed memory system, different CPU units have their own memory systems. Access from another CPU will most likely be slower or with a more limited coherency model, if indeed it is possible at all. This will be more typical of a message-passing multiprocessor.

Using multiple threads for parallel programming is more of a software paradigm than a hardware issue, but you are correct, use of the term thread essentially specifies that a single shared memory is in use, and it may or may not include actual multiple processors. It may not even include multiple kernel threads, in which case the threads will not execute in parallel.

I'm not completely clear on the meaning of last question. Certainly, by saying "distributed memory" or "shared memory" it implies "distributed over processors" and "shared by processors", so I suppose the terms are only reasonably applied to multiprocessor or potentially multiprocessor systems. If we are talking about multiple processes in the software sense, I guess it's pretty much a requirement for distributed memory systems, and essentially a requirement (they might be called threads) for a shared memory system.

DigitalRoss
Thanks! By multiprocess, I mean a parent process with child processes spawned from it. I do not mean multiple processors.
Tim
Well, in that case, **usually no**, because a distributed memory multiprocessor is unlikely to be running a single kernel, so the processes running on other CPU units are probably created on separate kernels, by separate servers, in response to messages from some master CPU or whatever software system originated the job. It's certainly possible to make a coherent distributed memory machine that runs a single kernel, in which case **"yes"** but that's kind of the lunatic fringe of multiprocessing and you won't see it very often.
DigitalRoss