text stringlengths 2 132k | source dict |
|---|---|
12.7 Hamilton Cycles Learning Objectives ------------------- **After completing this section, you should be able to:** 1. Calculate the expected value of an experiment. 2. Interpret the expected value of an experiment. 3. Use expected value to analyze applications. The casino game roulette has dozens of different bets ... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
What’s the best play to make at a roulette table? In this section, we’ll develop the tools we need to answer these questions. Expected Value -------------- Many experiments have numbers associated with their outcomes. Some are easy to define; if you roll 2 dice, the sum of the numbers showing is a good example. In some... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
theoretical expected value before we even run the experiment the first time. FORMULA ------- Expected Value: If O O O represents an outcome of an experiment and n(O)n(O)n(O) represents the value of that outcome, then the expected value of the experiment is: ∑n(O)×P(O)∑n(O)×P(O)∑n(O)×P(O) , where Σ Σ Σ is the “sum,” mea... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
6 1 6 1 6 | 3×1 6=1 2 3×1 6=1 2 3×1 6=1 2 | | 4 | 1 6 1 6 1 6 | 4×1 6=2 3 4×1 6=2 3 4×1 6=2 3 | | 5 | 1 6 1 6 1 6 | 5×1 6=5 6 5×1 6=5 6 5×1 6=5 6 | | 6 | 1 6 1 6 1 6 | 6×1 6=1 6×1 6=1 6×1 6=1 | **Step 3:** We add all of the values in that last column: 1 6+1 3+1 2+2 3+5 6+1=7 2=3.5 1 6+1 3+1 2+2 3+5 6+1=7 2=3.5 1 6+1 3+... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
9 | | 6 | 5 36 5 36 5 36 | | 7 | 1 6 1 6 1 6 | | 8 | 5 36 5 36 5 36 | | 9 | 1 9 1 9 1 9 | | 10 | 1 12 1 12 1 12 | | 11 | 1 18 1 18 1 18 | | 12 | 1 36 1 36 1 36 | **Step 2:** We can multiply each row to find n(O)×P(O)n(O)×P(O)n(O)×P(O)as shown in the following table: | Value | Probability | n(O)×P(O)n(O)×P(O)n(O)×P(O) |... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
6+1 3+5 9+5 6+7 6+10 9+1+5 6+11 18+1 3=7 1 18+1 6+1 3+5 9+5 6+7 6+10 9+1+5 6+11 18+1 3=7 1 18+1 6+1 3+5 9+5 6+7 6+10 9+1+5 6+11 18+1 3=7 . So, the expected value is 7. 3. **Step 1:** Let’s make a PDF table for this experiment. There are 3 events that we care about, so let’s use those events in the table below: | Event ... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
sum of the last column: 15 13+40 13+40 13=95 13≈7.3 15 13+40 13+40 13=95 13≈7.3 15 13+40 13+40 13=95 13≈7.3. Thus, the expected _Rummy_ value of a randomly selected card is about 7.3. Your Turn 7.37 -------------- 1 was just the mean of the numbers on the faces of the die: 1+2+3+4+5+6 6=3.5 1+2+3+4+5+6 6=3.5 1+2+3+4+5+... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
expected values can always be treated as a special kind of mean called a **weighted mean**, where the weights are the probabilities associated with each value. When the probabilities are all equal, the weighted mean is just the regular mean. Interpreting Expected Values ---------------------------- As we noted, the exp... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
where you flip a coin 3 times. If all 3 flips result in heads, you win $20. If you get 2 heads, you win $10. If you flip 1 or 0 heads, you win nothing. Interpret the expected value of your winnings. Who Knew? --------- ### Pascal’s Wager The French scholar Blaise Pascal (1623–1662) was among the earliest mathematicians... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
6=−1 3≈−$0.33$3×1 6+(−$1)×5 6=−1 3≈−$0.33, meaning you should expect to lose about 33 cents on average for every time you play. Playing that game is not a good idea! In general, this is how casinos and lottery corporations make money: Every game has a negative expected value for the player. Who Knew? --------- ### Expe... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
gambling buddy Blaise Pascal to answer a question that he’d read about called the “problem of points.” The question goes like this: Suppose you’re playing a game that is scored using points, and the first person to earn 5 points is the winner. The game is interrupted with the score 4 points to 2. If the winner stood to... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
for the “arithmetical triangle” that is named for him (though he wasn’t the first person to discover it; see the section on the binomial distribution, as well as work in geometry. In physics, Pascal worked on hydrodynamics and air pressure (the SI unit for pressure is named for him), and in philosophy, Pascal advocated... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
3 4 3 4 3 4, and so the expected value is $2×1 4+(−$1)×3 4=−$0.25$2×1 4+(−$1)×3 4=−$0.25$2×1 4+(−$1)×3 4=−$0.25. 2. There are 20 C 2=190 20 C 2=190 20 C 2=190 winning choices out of 80 C 2=3,160 80 C 2=3,160 80 C 2=3,160 total ways to choose 2 numbers. So, the probability of winning is 190 3,160 190 3,160 190 3,160 and... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
The bet that’s the best for the player is the one with the highest expected value for the player, which is guessing two numbers. The best one for the casino is the one with the lowest expected value for the player, which is guessing one number. Your Turn 7.39 -------------- The casino game craps involves rolling 2 stan... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
value that the lottery will make money. Aim for the expected value to be about −0.25 times the cost of playing the game. Check Your Understanding ------------------------ You are about to roll a 20-sided die with faces labeled as follows: 5 faces have a 1, 6 faces have a 3, 4 faces have a 5, 3 faces have a 7, and 2 fac... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
also occasionally have the opportunity to speculate. Players choose any 2 of the 10 numbers on the spinner and then give it a spin. If one of their numbers is chosen, they win $140,000; if not, they lose $10,000. 5. What is the expected value of this speculation? 6. Interpret your answer. 7. Which is better for _The Ga... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
yellow balls selected. 2. What is the expected number of yellow balls selected? 16. Suppose you draw 3 balls _without_ replacement. 1. Give a PDF table for the possible outcomes for the number of yellow balls selected. 2. What is the expected number of yellow balls selected? 17. If you draw a single ball, what is the e... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
amount. (You can watch the game being played in the video Playing "Punch a Bunch." and a color (0 and 00 are both green; the other 36 numbers are evenly divided between black and red). Players make bets on which number (or groups of numbers) they think the marble will land on. The figure shows the layout of the numbers... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
The columns represent 2 to 1, 2 to 1, and 2 to 1. Two green pockets, 0 and 00 are at the top-right. Six green pockets on the left represent 1 to 18, even, red, black, odd, and 19 to 36. The data from the table row-wise are as follows: 1 (red), 2 (black), 3 (red); 4 (black), 5 (red), 6 (black); 7 (red), 8 (black), 9 (re... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
they win $60 if 0, 00, 1, 2, or 3 come up but lose $10 otherwise. What is the expected value of this bet? 35. Interpret your answer to previous question. 36. Which is better for the player: a $10 first dozen bet or a $10 basket bet? How do you know? [Previous]( [Order a print copy]( Citation/Attribution This book may n... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
a 501(c)(3) nonprofit. [Give today]( and help us reach more students. ### Help * [Contact Us]( * [Support Center]( * [FAQ]( ### OpenStax * [Press]( * [Newsletter]( * [Careers]( ### Policies * [Accessibility Statement]( * [Terms of Use]( * [Licensing]( * [Privacy Policy]( * Manage Cookies © 1999-2025, Rice University. E... | {
"page_id": null,
"source": 6845,
"title": "from dpo"
} |
Title: URL Source: Markdown Content: DISTRIBUTED ALGORITHMS 2015/2016 # Exercise Session 3 - Solutions Causal and Total Order Broadcast # Exercise 1 Can we devise a broadcast algorithm that does not ensure the causal delivery property but only its nonuniform variant: no correct process pi delivers a message m2 unless ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
at a position matching the rank of the sender. During the next iteration, the process needs to deliver a message containing all zeroes in its vector clock, while the process has a non-zero value in at least one position. # Exercise 4 Can we devise a best-effort broadcast algorithm that satisfies the causal delivery pro... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
components of the process are affected and stop (including the best- effort broadcast module and any further underlying modules, such as the modules that may implement perfect links). The unit of failure is a process, not a module. For this exercise only, consider an idealized and nonrealistic system model, where some ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
in a failure-prone environment, as it would not preclude the following scenario. Assume that a process p broadcasts several messages with best-effort properties and then crashes. Some correct processes might end up delivering all those messages (in the same order) whereas other correct processes might end up not delive... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Title: URL Source: Markdown Content: # Contents 1 Introduction 7 1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2 Aims and Objective . . . . . . . . . . . . . . . . . . . . . . . 81.3 Approach . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81.4 Dissertation Overview . . . . . . . ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . . . . 19 2.5.2 Failure Model . . . . . . . . . . . . . . . . . . . . . . . 20 2.6 Recurring Agreement Problems in Distributed Computing . . 22 2.6.1 Reliable Broadcast . . . . . . . . . . . . . . . . . . . . 22 2.6.2 Consensus . . . . . . . . . . . . . . . . . . . . . . . . . 24 2.6.3 Atomic Commit . . . . . ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
of Erlang . . . . . . . . . . . . . . . . . . 33 2.9.4 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . 35 3 Implementation Framework 36 3.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36 3.2 Distributed Computing Abstractions . . . . . . . . . . . . . . 36 3.2.1 Processes . . . . . .... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . . . . . . . . . . . . . . . . . . . . . 44 3.5.1 Variables . . . . . . . . . . . . . . . . . . . . . . . . . 44 3.5.2 Atoms . . . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.5.3 Comments . . . . . . . . . . . . . . . . . . . . . . . . . 45 3.5.4 Tuples . . . . . . . . . . . . . . . . . . . . . . . . ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . . . . . . . . . . . . . . . . 56 4 Reliable Broadcast 57 4.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.2 Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57 4.3 Best Effort Broadcast . . . . . . . . . . . . . . . . . . . . . . 58 24.3.1 Overview . . . . . .... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . . . . . . . . . . . . . . . . . . . 61 4.4.3 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 61 4.4.4 Erlang Implementation . . . . . . . . . . . . . . . . . 65 4.4.5 Evaluation . . . . . . . . . . . . . . . . . . . . . . . . 66 4.5 Uniform Reliable Broadcast . . . . . . . . . . . . . . . . . . . ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
73 4.6.1 Specification . . . . . . . . . . . . . . . . . . . . . . . 74 4.6.2 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . 75 4.6.3 Erlang Implementation . . . . . . . . . . . . . . . . . 78 4.6.4 Implementation Optimisations . . . . . . . . . . . . . 79 4.6.5 Evaluation . . . . . . . . . . . . . . . . .... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . 82 5.4.2 Specification . . . . . . . . . . . . . . . . . . . . . . . 83 5.4.3 Flooding Algorithm . . . . . . . . . . . . . . . . . . . 83 35.4.4 Hierarchical Algorithm . . . . . . . . . . . . . . . . . . 93 5.5 Uniform Consensus . . . . . . . . . . . . . . . . . . . . . . . . 98 5.5.1 Overview . . . . . . . . .... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . 103 5.6.2 Specification . . . . . . . . . . . . . . . . . . . . . . . 103 5.7 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104 5.8 Erlang Implementation . . . . . . . . . . . . . . . . . . . . . . 107 5.9 Implementation Optimisations . . . . . . . . . . . . . . . . . 108 5.10 Evaluation... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Phase Commit Algorithm . . . . . . . . . . . . . 112 6.4.2 Three Phase Commit Algorithm . . . . . . . . . . . . 115 6.5 Asynchronous Consensus Based Algorithm . . . . . . . . . . . 120 6.5.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . 120 6.5.2 Algorithm . . . . . . . . . . . . . . . . . . . . . . . . . ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . . . 128 7.2.3 Module Testing . . . . . . . . . . . . . . . . . . . . . . 130 7.2.4 System Testing . . . . . . . . . . . . . . . . . . . . . . 132 7.2.5 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . 133 7.3 Case-Study . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133 7.3.1 Overview . . .... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . 141 8.2.1 Separation of Concerns . . . . . . . . . . . . . . . . . 141 8.2.2 Shorten development time . . . . . . . . . . . . . . . . 142 8.2.3 Structured Code . . . . . . . . . . . . . . . . . . . . . 142 8.2.4 Agreement Algorithm Abstractions . . . . . . . . . . . 143 8.2.5 Code Reuse . . . . . . . . . . . . ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. . . . . . . . . . . . . . . . . . 147 8.5.2 Memory Requirement . . . . . . . . . . . . . . . . . . 149 8.6 Assessing the failure detector implemented . . . . . . . . . . . 150 8.7 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151 9 Conclusion and Future Work 152 59.1 Alternative Failure Detector ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
. 156 A.3 Starting a shell . . . . . . . . . . . . . . . . . . . . . . . . . . 157 A.3.1 Explanation . . . . . . . . . . . . . . . . . . . . . . . . 157 A.4 Initializing the Suite of protocols . . . . . . . . . . . . . . . . 157 6Chapter 1 # Introduction # 1.1 Overview Writing correct concurrent code is no easy feat. I... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Distributed 7Programming, this means that systems have to be programmed from a local observers view which handles all interactions autonomously, without the need of a global coordinator. Such an approach overcomes the issue of single point of failure, nevertheless brings about various intricacies which need to be reso... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
get accustomed to the notion of distributed programming. Following this, we dealt more with the actual implementation of the project 8itself. The various stages involved in this project were: 1. Performing research on distributed computing systems and the prob-lems associated with programming is such systems. 2. Perfor... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
commit class of agreement problems is investi-gated. Once again, here different algorithms are studied, and are imple-mented in Erlang. Chapter 7 provides the details of the testing which was required for the system. It gives out the testing strategy followed for the implementation of the developed suite of algorithms.... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
has been around since the early days of networking and the internet. In reality, the need for such a system was felt since the early days of computing, but throughout recent years, their applications increased drastically. Often computer systems have to deal with resources which are remotely located. These resources ma... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
document - to clearly demonstrate instances of distributed problems being studied. p2pF s is a simple distributed file system, p2pFs with the following proper-ties: 1. Decentralized There is no central overall leader coordinating the filesystem. 2. Consistent At a particular time, all files appear the same from all nod... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
passed to the application to which it is intended ( p2pF s ), the message is said to be delivered (refer Figure 2.1 (b) ). Note that we are hence introducing the existence of a layer between the node and the application itself - which might decide that the message should not be delivered to the application, despite bei... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
being studied, is outlined. These problems will be studied in depth later. 1. Reliable Broadcast Reliable Broadcast deals with the safe transfer of a message to a number of nodes, despite the eventuality of having nodes which fail during this process - including the sender itself. For example, in the p2pF s scenario o... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
E after submitting its version of the file to S, but before submitting to the rest, results in an inconsistent system. A simple solution might be everyone broadcasting his version of the file to oneanother and the receiver nodes always keeping the file which has a largest filesize . However, similar to the reliable bro... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
can be deleted from all nodes. These problems have been the basis of various research . A number of results have been established which identify limitations on the solutions to these problems, in various contexts of time and failures. Nevertheless, since these problems are central in the design of fault-tolerant distri... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
lock. Contention on the locking depends on the underlying fairness of the lock and the scheduling algorithm. Having acquired the lock, a process executes its Critical Section and releases the lock. Despite being rather straight-forward, lockful programming gives rise to various caveats including deadlock, livelock, pri... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
approach, especially the field of Software Trans-actional Memory started gaining ground, however as systems starts getting larger and the amount of concurrent atomic actions start to escalate. In particular, lots of processes start interfering, and more memory needs to be copied to allow for the reversing of its conten... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
2. A known upper bound exists on the time between execution steps of a process. 3. A known upper bound exists on the clock drifts of the interacting processes. On the other hand, the asynchronous distributed system model does not provide any timing bounds on its operations. The asynchronous model is more general but al... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
of Process Failures. (source ) A process is said to have failed, when it deviates from the algorithm which describes it. Upon failure, any other components under direct control of this failed process are assumed to also fail - and remain in this state unchangingly. Figure 2.5, gives a diagramatic classification of diff... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
generally handled by transport layer protocols). In this work, we will focus mainly on Crash Failures . . 2.5.2.2 Link Failures An interconnecting link may be considered as nonoperational if messages get garbled or are lost. The former case can be handled trivially with check-sums. Lost messages on the other hand can b... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
be perfect. # 2.6 Recurring Agreement Problems in Distributed Computing Earlier on in this chapter, a number of recurring distributed problems were outlined. In this section we will study these problems in further detail. 2.6.1 Reliable Broadcast Reliable Broadcast truly is a term which captures a number of broadcast p... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
processes. Such a situation can be detrimental in certain situations and hence the Uni-form Reliable Broadcast fixes this anomaly by strengthening the broadcast specification with the following property : • Uniform Agreement : If a message m is delivered by some process pj (correct or faulty), then m is eventually deli... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
decides on some value. Again as with the case of Regular Reliable Broadcast , there can be a situ-ation where faulty processes decide differently (before failing), than correct processes. In order to restrict this situation, Uniform Reliable Broadcast satisfies another property : • Uniform Agreement : No two processes ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
to commit the result, otherwise it sends a request to abort the commit. The first Commit abstraction which is considered is the Blocking Commit .This abstraction satisfies the following properties : • Agreement : No two processes decide to take different actions • Validity :1. If any process votes No , then abort is th... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
on the message delay and bound φ on the relative speeds of the processes (slowest process takes at most φ multiplied by time taken by fastest process to perform the same action). Partially synchronous systems try to strengthen the bounds of asynchronous systems in some way. For example, a partially synchronous system m... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
detector, and at any point in time, their output (set of suspected processes) can be different - however eventually these failure detectors are expected to converge their suspected processes sets. A Failure Detector is defined by a pair ( c, a ): • c: A Completeness property specifying that all failed processes should ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
failure detector class W in this taxonomy, can also be used to solve consensus. It is shown that W is guaranteed to solve consensus only if n > 2f where n is the number of processes and f is the number of failed processes - there is a majority of correct processes. Furthermore, in a related paper , it is proven that ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
hardware to support this ab-straction. However, most implementations of failure detectors are based on timeout mechanisms” . This paper goes on to show a failure detector which works with timeouts. Every time a process is detected to have been sus-pected wrongly, its timeout is increased. The paper then states that des... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
: Processors should be notified when an-other processor fails, and given a reason for this failure. • Stable Storage Property : Processors should be able to store data in some reliable medium which persists a node failure. Furthermore, in , Gray applies this idea of fail stop processors to pro-cesses which is referred ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
- and all this does not affect the programmer of the system itself. In the past few years, a number of distributed programming languages each implementing its own flavour of message passing distribution, have been proposed. Andrews in suggests that these languages should be com-pared according to their basic communic... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
for solving distributed programming problems (such as cop-ing failure). Moreover, in languages such as Erlang, it is rather easy to > 2These two languages are not really distributed languages - rather these are concurrent languages. 31 ”mimic” RPC’s with custom behaviour . 2.9.1 Erlang Erlang is a functional programmin... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
set apart Erlang from other concurrent languages (such as Occam) and concurrent/distributed libraries for traditional programming languages (such as OpenMP for C++ and Parallel Extensions Framework for .Net). In fact, these languages fail to define explicitly behaviour under failure. 32 2.9.3 The strength of Erlang In ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
target robust code. The functional syntax of Erlang might be a repelling feature for, however it reduces the amount of code re-quired between four to ten times . Generally, more code means more bugs and hence these are suppressed as well. Moreover, thanks to the requirement of non mutable state functions, Erlang cuts d... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
con-current languages or frameworks - making Erlang the natural language of choice for various distributed projects. Among the various systems which are running Erlang code underneath the hoods, one finds: the Facebook’s chat server, Wings 3D - a 3D graphics engine and modeller, Amazon’s distributed database SimpleDB a... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
, Leslie Lamport , Toueg and Chandra , Guerraoui and Rodrigues . In this chapter, a common framework for the implementation of such al-gorithms in Erlang, is outlined. This chapter builds on Erlang’s features, to achieve a framework which provides the necessary environment for the implementation of such algorithms. In ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
processes identification - that is despite the distributed environment, no two processes (not even on distributed nodes) can have the same PID. Note that this is a fair assumption to make because Erlang guarantees such a property is true by encoding data about the node identifica-tion in the PID itself. Another way by ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
to the abrupt termination of all the other processes in that shell. 3.2.3 Communication Links Interconnecting distributed nodes involves various infrastructure such as routers and switches. This setup varies greatly depending on the underlying network architecture. In this project, all this infrastructure is captured b... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
provide information as to which processes it detects as having crashed. Fail-ure detector can only give information as to whether a process is alive or not, but does not give information about the state of the processes (such as its point of execution). Moreover, in this project a Perfect Failure Detector is assumed. T... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
are explained in detail below: • Module Name : The module definition defines the name of the mod-ule. It is used when external modules need to call functions or trigger events locally defined in this module. • Behaviours implemented : This concept comes directly from the Erlang behaviours. In Erlang, a behaviour is a g... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
carried out asynchronously. 3.3.1 Types of event triggering Events can be triggered in two ways. Firstly, an event may be directly-triggered by some module through the use of the trigger keyword. The other type of event triggering is predicate triggered event triggering. Such events will be triggered when a particular ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
predicate triggered event handler. On line 1, preceded by the upon keyword, there is the pred-icate condition which will trigger this event. As an example, listing 3.4b shows an event which is triggered when a set (Colours) gets an element with value blue. Figure 3.4: Syntax of predicate triggered events. 42 3.4 Module... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
of a callback. As an example, consider a module for broadcasting messages called broad-caster . This module is able send out messages, by handling the broad-cast(Data) event. Moreover, when a message is received, it callbacks the deliver(Data) event. Now consider, a module called namer , which is used to send and recei... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
assigned mut-liple values. However in section 3.2.4, a method to convert to pure single 44 assignment, as used in Erlang, is described. 3.5.2 Atoms Atoms are simply symbols (identifiers) which can be assigned. As an exam-ple, yellow in Listing 3.4, is an example of an atom. Atoms are different from enumerated variables... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Receiving messages Since this project deals with distribution over remote nodes, there must be a way for communication amongst these nodes to take place. This is done by using message sending and receiving constructs. These constructs are taken directly from the Erlang language. Sending messages is done through the use... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Main process, only the PID of the Main processes is required to be known. Sender processes will send their messages to the Main process of the destination node, which will in turn take care of ”forwarding” the message to the corresponding receiver process. But how does the main process know which process is the intende... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
be received, but rather when the message is received, this event handler will be triggered. 48 3.6.1.2 Utilizing the Erlang Failure Detector A lot of emphasis has been made on the use of failure detectors as means by which to abstract knowledge about failures. However, in figure 3.6, these do not seem to have a directl... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
- once a process is suspected to be failed, it will not be classified as alive (unless the process is manually re link ed). This violates the accuracy property because it causes processes to be falsely detected as having failed. Hence Erlang’s failure detector can be merely seen as performing any spe-cial failure detec... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
process which maintains the state of that particular algorithm. These algorithms were each implemented in separate modules. This mod-ule, essentially, handles events it receives and changes the state accordingly. Below is a list of all the modules implemented: • Reliable Broadcast 1. be rb : Best-Effort Reliable Broadc... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
gen server is written to make 51 code more scalable and maintainable . It also gives way to easier debug-ging and easily provides features such as dynamic upgrades. Moreover, by using the generic server, the code will be structured in a ’standard’ way -making it easier for external programmer to understand and work wit... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
event2 ). The export on line 12, lists the functions which act as the callbacks implemented for other modules. The crash event is triggered by the failure detector and should be implemented by all processes using the failure detector. Thus, in terms of code, an event is simply a function call defined in a module. That ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
whilst the second one is the State of the server. Note that this function uses function pattern matching to choose which of the functional clauses to invoke. Internally this handler will perform the algorithmic action required to handle the request. Notice that this function returns a tuple which holds the updated stat... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
the predicates. Otherwise, the passed State is returned. 55 3.6.4 Working with Single Assignment Being a functional language, Erlang has single assignment of variables. Es-sentially this means that every variable can only be assigned a value once. However, the algorithms presented in literature, never assume they are w... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Reliable Broadcast specifications are presented, each having its own set of properties and characteristics. For each specification, an algorithm attempting to achieve these specifications, is outlined. For all algorithms, first the basic goal it attempts to achieve, is explained. Following this, the algorithms are expl... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
as the Basic Broadcast algorithm. The algorithm consists of just two event handlers. The broadcast event 58 Figure 4.1: Basic broadcast algorithm handler (line 9) is triggered by the user of this module, and it initiates a best effort broadcast. It iterates through all the processes in the system (denoted by Π on line ... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
the destination, and since this is sent to all processes, the validity property is satisfied. Moreover, the integrity property, follow directly from the no creation and no duplication properties of links (refer 3.2.3). The Basic Broadcast algorithm, however, only guarantees agreement if the sender is not faulty. Figure... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
all correct processes in the system. • Integrity : For any message m, every process delivers m at most once, and only if it was previously broadcast. 4.4.3 Algorithm One particular implementation of the Regular Reliable Broadcast is the Lazy Reliable Broadcast algorithm, given in the listing in figure 4.3. This algo-ri... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
will relay the message to the other processes in the system. In this run of the algorithm, only one process ( P2) was lucky enough to be sent the message before the death of the sender. If more processes were sent this message, more than one process would become a relay of the sender process. Since the job of the relay... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
broadcast event is triggered. It is important to note that the content of the message being broadcasted is a tuple with the following structure: { Sender, Message} The Sender contains the PID of the initial sender: because the message may be relayed by other processes; however, these do not change this sender field. Th... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
If this is not so, then it might be that this process was one of the (lucky) processes who managed to get the message. Hence, this message should be broadcast ( best effort broadcast) to the other processes - so as to ensure that all other processes managed to get the message despite that the sender crashed. The second... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
the algorithm would not think it has already delivered 65 this message. However, in the case when multiple relay processes broadcast the same message, this number is not altered and hence the receiver would determine that it has received a message which has already been delivered. Another important consideration is the... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
underlying usage of the Best Effort Broadcast . It satisfies the Agreement property because once a sender crashes, if a receiver exists, its failure detec-tor will eventually cause a crash event and the message will be sent to the other nodes. The Regular Reliable Broadcast provides fault tolerant prop-erties which ens... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
this eventually gets delivered by all correct processes in the system. • Integrity : For any message m, every process delivers m at most once, and only if it was previously broadcast. 4.5.3 Algorithm An algorithm to implement the Uniform Reliable Broadcast abstraction needs to ensure that all nodes have received the me... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
is sure that all other processes received it. Listing 4.5 presents the All-Ack Uniform Reliable Broadcast algorithm which is an implementation of the Uniform Reliable Broadcast protocol. The Al-gorithm ensures that the messages has reached all processes before actually delivering it. This is done by having each process... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
a mapping between messages and a set with processes from which that message was received. As hinted earlier, this algorithm delivers a message only when it has been received from all other processes. The can deliver() helper function (lines 15 to 16) checks whether the Correct set is a subset or equal to the set of pro... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
of this set can be seen in histories such as the run shown in figure 4.7. Here P1 starts the broadcast. Process P2 receives this message and rebroadcasts it, however it crashes shortly afterwards. Note that since here a totally asynchronous network is assumed, process P3’s failure detector can determine that process P2... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
that once a message can be delivered, then it can be removed from the Pending set. Moreover its associated set from the Ack map can also be freed. This tweak will prevent the Pending and Ack sets from growing indefinitely. However, the message cannot be removed from the Delivered set. The ne-cessity of the Delivered se... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Order Broadcast In all the broadcast specifications outlined so far, the focus was on the guaranteeing properties within a single broadcast operation and not on its possible interaction with other broadcasts already taking place. In partic-ular, due to the asynchrony of the network, a process could perform two consecut... | {
"page_id": null,
"source": 7318,
"title": "from dpo"
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.