This first lecture is devoted to an introduction to the course and to the area of distributed systems. We will outline a number of examples of distributed systems and elaborate on their basic characteristics and design challenges. Finally, we introduce basic models of distributed systems.
Literature[DS] Chapters 1-2.
You might also consider reading [DS] chapter 3 to refresh what you learned in
the networking course.
1 socket= new Socket("MyBank");
2 sent_bytes=socket.send("Add 10",7);
3 ...
4 socket.close();
The second argument of the send call indicates the number of bytes that should be sent, thus in this case 7 bytes, including zero-termination of the string. The send call returns the number of bytes actually successfully sent. Assume now that the call has returned the value 7, and that we are currently executing line 3. If the bank account initially contained 100 DKK, are you now sure that the account contains 110 DKK???
Hints: Consider Figure 2.9 and Table 2.10 in the textbook, and read the fine print of manual pages describing send on tcp sockets, eg.
- http://msdn2.microsoft.com/en-us/library/w93yy28a.aspx
- http://www.penguin-soft.com/penguin/man/2/send.html?manpath=/man/man2/send.2.inc