What is the key advantage and disadvantage of each of shared memory and message
ID: 3600836 • Letter: W
Question
What is the key advantage and disadvantage of each of shared memory and message passing with respect to the other? Write a shared memory version and a message passing version of a program to find the sum of the elements of a large array of integers (large as in tens of billions). Follow the lecture example of Ocean What does cache coherence achieve? Why is that important for the shared memory abstraction'? Why does our MSI protocol write back the block to memory on a BusRdX to an M block even though memory will continue to be stale due to the new writer? 1. 2. 3. 4.Explanation / Answer
Answer to Question number 1:-
Shared memory is a memory resource that is accessed by multiple programs or processes for passing data or information between the processes or programs which can share data by reading or writing. Shared memory is an efficient means of passing between processes. So the same piece of data cannot be altered or worked upon by different programs or processes in shared memory.
Pros:- Very fast way of communication. Space efficient as memory is shared.
Cons:- Each process/program can both read and write, but a program must establish and follow some protocol for preventing race conditions such as overwriting information before it is read. So this needs to be handled.
Message Passing:- Message passing is a type of communication between processes. Message passing processes use their local memory during computation. These processes exchange data or information by passing messages and requires co-operative data transfer.
Pros - Hardware necessary is simple. Communication is effective for all messages.
Cons - Receiving process might want to do something else if no message is received. In other words, receiving messages is very important in this process. Also sending process might want to continue without waiting for confirmation of receipt.
**// Please hit Like if you like the answer and comment for any other issues.
Thanks.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.