Presentation is loading. Please wait.

Presentation is loading. Please wait.

Review Questions on Chapter IV—IPC COSC 4330/6310 Summer 2013.

Similar presentations


Presentation on theme: "Review Questions on Chapter IV—IPC COSC 4330/6310 Summer 2013."— Presentation transcript:

1 Review Questions on Chapter IV—IPC COSC 4330/6310 Summer 2013

2 First Question  How can you implement the at most once semantics in a remote procedure call package?

3 First Question  How can you implement the at most once semantics in a remote procedure call package? By adding sequence numbers to all client requests and instructing the server to ignore requests with duplicate serial numbers By adding sequence numbers to all client requests and instructing the server to ignore requests with duplicate serial numbers

4 First Question  What is the major advantage of atomic transactions?

5 First Question  What is the major advantage of atomic transactions? They either execute correctly or not at all They either execute correctly or not at all We do not have to worry about partial executions or duplicate executionsWe do not have to worry about partial executions or duplicate executions

6 First Question  How can you simulate a blocking receive primitive using a non-blocking receive ?

7 First Question  How can you simulate a blocking receive primitive using a non-blocking receive ? By doing a busy wait while (receive(…) == NO_MSG); By doing a busy wait while (receive(…) == NO_MSG);

8 First Question  What is the major advantage of streams over datagrams?

9 First Question  What is the major advantage of streams over datagrams? All data are transmitted in sequence and no data are damaged, lost or duplicated All data are transmitted in sequence and no data are damaged, lost or duplicated

10 First Question How do you pass a linked list to a remote procedure? How do you pass a linked list to a remote procedure?

11 First Question How do you pass a linked list to a remote procedure? How do you pass a linked list to a remote procedure? You send it as an array along with instructions how to rebuild it You send it as an array along with instructions how to rebuild it

12 First Question When should we worry about big- endians and little-endians? When should we worry about big- endians and little-endians?

13 First Question  When should we worry about big- endians and little-endians? Each time we exchange numerical data between two different machines Each time we exchange numerical data between two different machines Strings are never a problemStrings are never a problem

14 Second Question: True or False Second Question: True or False  All UNIX message passing primitives use direct naming.

15 Second Question: True or False Second Question: True or False  All UNIX message passing primitives use direct naming. FALSE, FALSE, they use sockets and sockets are private mailboxes

16 Second Question: True or False Second Question: True or False  Most servers use non-blocking receives.

17 Second Question: True or False Second Question: True or False  Most servers use non-blocking receives. FALSE, they use blocking receives FALSE, they use blocking receives

18 Second Question: True or False Second Question: True or False  Reliable datagrams guarantee that no message will be lost or duplicated.

19 Second Question: True or False Second Question: True or False  Reliable datagrams guarantee that no message will be lost or duplicated. FALSE, they only guarantee that no message will be lost or damaged FALSE, they only guarantee that no message will be lost or damaged Messages can still be duplicatedMessages can still be duplicated

20 Second Question: True or False Second Question: True or False  Making all remote procedures idempotent greatly simplifies the task of the RPC server.

21 Second Question: True or False Second Question: True or False  Making all remote procedures idempotent greatly simplifies the task of the RPC server. TRUE, we do not have to worry about multiple executions TRUE, we do not have to worry about multiple executions

22 Second Question: True or False Second Question: True or False  In a RPC, one of the tasks of the user stub is to exchange messages with the user program.

23 Second Question: True or False Second Question: True or False  In a RPC, one of the tasks of the user stub is to exchange messages with the user program. FALSE, the user stub is in the same address space as the user program FALSE, the user stub is in the same address space as the user program It exchanges messages with the server stubIt exchanges messages with the server stub

24 Third Question  What would you need to do to simulate streams using datagrams? (10 points)

25 Third Question  What would you need to do to simulate streams using datagrams? (10 points) Use positive acknowledgments to ensure that all messages will be delivered intact. Use positive acknowledgments to ensure that all messages will be delivered intact. Attach a serial number to each message to detect duplicate messages and reorder messages that arrive out-of-order. Attach a serial number to each message to detect duplicate messages and reorder messages that arrive out-of-order. Remove message boundaries. Remove message boundaries.

26 Fourth Question  Consider the function void doubletrouble(int *one, int *two) { *one += *one; *two += *two; } // doubletrouble`  and assume the calling sequence: alpha = 10; doubletrouble (&alpha, &alpha);

27 Fourth Question  What will be the value of alpha after the call assuming that The call was a conventional procedure call? Answer: alpha = ____________ The call was a conventional procedure call? Answer: alpha = ____________ The call was a remote procedure call? Answer: alpha = ____________ The call was a remote procedure call? Answer: alpha = ____________

28 Fourth Question  What will be the value of alpha after the call assuming that The call was a conventional procedure call? Answer: alpha = 40 The call was a conventional procedure call? Answer: alpha = 40 The call was a remote procedure call? Answer: alpha = ____________ The call was a remote procedure call? Answer: alpha = ____________

29 Fourth Question  What will be the value of alpha after the call assuming that The call was a conventional procedure call? Answer: alpha = 40 The call was a conventional procedure call? Answer: alpha = 40 The call was a remote procedure call? Answer: alpha = 20 The call was a remote procedure call? Answer: alpha = 20

30 Passing by reference Caller: … int alpha; alpha = 10; doubletrouble(&alpha, &alpha); … alpha Pass TWICE the ADDRESS of variable alpha Alpha gets incremented TWICE

31 Passing by value and result Pass twice the VALUE of alpha: 10 and 10 Return NEW VALUES: 20 and 20 Caller: … int alpha; alpha = 10; doubletrouble(&alpha, &alpha); … alpha


Download ppt "Review Questions on Chapter IV—IPC COSC 4330/6310 Summer 2013."

Similar presentations


Ads by Google