首页 > 试题广场 >

What are the benefits and detri

[问答题]
What are the benefits and detriments of each of the following?Consider both the systems and the programmers’ levels.
a.Symmetric and asymmetric communication
b.Automatic and explicit buffering
c.Send by copy and send by reference
d.Fixed-sized and variable-sized messages
推荐
a.Symmetric and asymmetric communication-A benefit of symmetric communication is that it allows a rendezvous between the sender and receiver.A disadvantage of a blocking send is that a rendezvous may not be required and the message could be delivered asynchronously;received at a point of no interest to the sender.As a result,message-passing systems often provide both forms of synchronization.
b.Automaticandexplicitbuffering-Automatic buffering provides a queue with indefinite length;thus ensuring the sender will never have to block while waiting to copy a message.There are no specifications how automatic buffering will be provided;one scheme may reserve sufficiently large memory where much of the memory is wasted.Explicit buffering specifies how large the buffer is.In this situation,the sender may be blocked while waiting for available space in the queue.However,it is less likely memory will be wasted with explicit buffering.
c.Send by copy and send by reference-Send by copy does not allow ther eceiver to alter the state of the parameter;send by reference does allow it.A benefit of send by reference is that it allows the programmer to write a distributed version of a centralized application.Java’s RMI provides both,however passing a parameter by reference requires declaring the parameter as a remote object as well.
d.Fixed-sized and variable-sized messages-The implications of this are mostly related to buffering issues;with fixed-size messages,a buffer with a specific size can hold a known number of messages.The number of variable-sized messages that can be held by such a buffer is unknown.Consider how Windows 2000 handles this situation:with fixed-sized messages(anything<256 bytes),the messages are copied from the address space of the sender to the address space of the receiving process.Larger messages(i.e. variable-sized messages) use shared memory to pass the message.

发表于 2018-05-05 22:02:20 回复(0)