Tuesday, January 28, 2020

Difference Between Bully and Ring Algorithm

Difference Between Bully and Ring Algorithm Compare bully and ring election algorithm Choose or design an algorithms in distributed system is a big challenging issue since past until now. The big challenge is calls for a suitable, efficient and no error election algorithm. Nodes communicate with each other using shared memory and through or via message passing. Coordinator will be the key requirement for nodes to execute or run any distributed task effectively and smoothly. There will be no central controlling node exists in a pure distributed system, every node has to communicate other nodes in the network to make an important decision. During the decision process all nodes will not often make the same decision. All involve the decision-making process and communication between nodes time-consuming. When consistency is needed, among all the nodes Coordination among nodes becomes harder. The main purpose of the leader election is to choose a node as a coordinator. It will act as a leader and coordinate activities of the whole system. A leader in any leader election algorithm is usually chosen based on the node which has the largest identifier. The nodes will reach a state called as terminated state once the leader is selected. There are 2 states which are elected states and non-elected states in the leader election algorithms. When a node enters either state, it always remains in that state. The leader election algorithm has to satisfy liveness condition and safety for an execution. The safety condition requires that only one single node can enter the elected state and it will become the leader of the distributed system. The liveness condition states that every node will eventually enter an elected state or a non-elected state. There are many election algorithms been proposed over the years such as Bully algorithm, Ring algorithm, Chang and Roberts algorithm, Le Lanns algorithm, and Franklins algorithm. All these algorithms require nodes to be directly involved in leader election. Nodes will transmit the messages to one another for exchange information until an agreement is reached. Once a node is been selected as leader, all the nodes will acknowledge the role as that node as leader. Bully algorithm The algorithm was devised by Garcia-Molina in 1982. While one of the process notices that the coordinator is not active, crashed, or responding to requests, it will start an election. Process Q, holds an election as follows: -Q sends a message to all the processes with higher numbers to start the election. -Q wins the election and becomes coordinator if and only if no higher numbers responds. -If there is one of the higher-ups number answers, it takes over. Qs job is finish or done. A process can receive an Election message from any one of its lower-numbered nodes at any moment. The receiver sends a confirmation message back to tell the sender that it is active and will take over when an Election message received. If other processes do not respond, and there is only one then it will become the new coordinator. After that, it will send all processes a message to announce its victory and starting immediately it will be the new coordinator. If a process that was down before but come back up, it will hold an election. If it happens to be the highest-numbered process among other currently running processes, it will win the election then will become leader and take over the coordinators job. Process 4 holds an election Process 5 and 6 respond, telling 4 to stop Now 5 and 6 each hold an election Process 6 tells 5 to stop Process 6 wins and tells everyone Modified Bully Algorithm In Bully algorithm, the number of message be exchanged between processes is very high. Thus, this Modified Bully Algorithm been devised to reduce the heavy traffic in network. Besides to reduce the heavy traffic flow in network, the number of stages is decreased from at most five stages to at most four stages. The algorithm has following steps: 1st step When process Q notices coordinator had crashed, it will start an election. 2nd step Q will send Election message to all other processes with higher priority numbers when Q find out that the coordinator was crashed. 3rd step All the processes that receives message which with higher priority process than Q will send OK message back to process Q with its unique priority number. 4th step If no processes responses to process Q, Q will broadcast one Coordinator message to all processes to declare itself as a coordinator. In vice versa, process Q will select the process Q with the highest priority number as coordinator and then send to it the GRANT message. 5th step Coordinator process will broadcast message to all the processes and informs them that itself as a coordinator at this stage. 6th step After the process with higher number compare to coordinator is up, modified Bully algorithm is run immediately. It does not have the drawback of Bully algorithm which has high number of message passing. If a higher priority number process crashes after sending it priority number to Q, Process Q will send GRANT message to it meaning that itself is the highest process and Q waits for broadcasting coordinator message else it will continue run the modified Bully algorithm. After a certain time or period, process Q does not receives any Coordinator message, it will repeat the algorithm again. Thus, this algorithm is efficient and safe to use for select the coordinator. Figure 2 The modified Bully election algorithm Process 2 holds an election. Processes 3, 4, 5 and 6 respond, telling its unique priority number. Now 3 comparing the priority number and select the highest process (process 6) and send a message to its (GRANT). Process 6 tell to everyone that it is coordinator. Token Ring algorithm Token ring algorithm is totally different with Bully algorithm. It achieves mutual exclusion by creating a bus network of processes in distributed system. It does not have a real ring in the network but a logical ring is constructed with all processes and all processes are assigned a position in the ring. All the processes know who is before them and next after them in the line. Token Ring algorithm works: 1st step: Process 6 is down. 2nd step: Process 3 notices that Process 6 does not respond. So it starts an election, sending a message containing its id to the next node in the ring. 3rdstep: Process 5 passes the message on, adding its own id to the message. 4th step: Process 0 passes the message on, adding its own id to the message. 5th step: Process 1 passes the message on, adding its own id to the message. 6th step: Process 4 passes the message on, adding its own id to the message. 7th step: When Process 3 receives the message back, it knows the message has gone around the ring, as its own id is in the list. Picking the highest id in the list, it starts the coordinator message 5 is the leader around the ring. 8th step: Process 5 passes on the coordinator message. 9th step: Process 0 passes on the coordinator message. 10th step: Process 1 passes on the coordinator message. 11th step: Process 4 passes on the coordinator message. Process 3 receives the coordinator message, and stops it. Modified Token Ring algorithm This algorithm is modified from Token Ring algorithm. It is modified to reduce the number of message passing and additional message being sent to the elected leader. When the leader has crashed and been noticed by a node, it will send its ID number to the node next to it in the ring. It is not necessary for all nodes to send their IDs into the ring. The receiving node compares the received ID with its own, and forwards whichever is the greatest at this moment. But this comparison is done by all the nodes such that only the greatest ID remains in the ring. After that, the greatest ID will return to the initial node. It declares itself as the leader by sending a coordinate message into the ring if the received ID equals that of the initial sender. This method will dramatically reduce the overhead involved in message passing. Besides that, if there is many nodes notice the leader crashed or absence at the same time, only the message of greatest ID node circulates in the ring and it will prevent the smaller IDs from being sent message in the ring. Modified Token Ring algorithm works: Nodes 2 and 4 notice that the coordinator has crashed simultaneously They send their IDs into the ring The greatest ID always remain in the ring The greatest ID keep passing in the ring 5 is declared as the leader Advantages and limitation algorithms Bully algorithm and Modified Bully algorithm Both of these algorithms have almost the same advantages. They can always check the liveness of the leader by the assumption of message delivery. The process is chosen as the non-crashed process at the end of the run with the largest process number if no process is replaced. It is impossible for two processes to decide which coordinator among them is, since the process with the lower number will discover that the other exits and defer to it. However, Modified Bully algorithm has another advantage that Bully algorithm does not have. That is the lower traffic passing. It reduce the traffic in the message communicate passing compare to Bully algorithm. It does not let the lower numbered process involve in the election but just higher numbered process. It also will send a GRANT message to the process which wins in the election. Then the process which wins will announce the message that declares itself as leader to all the nodes. It is more less traffic flow in the process and it is much better than Bully algorithm. The Bully algorithm also suffers from many shortcomings. This algorithm is not guaranteed to meet the safety condition if processes that had crashed and replaced by processes with the same number. A process that replaces the crashed process Q may decide which has the highest number just as another process has decided that it has the highest number. Both of them will announce themselves as the coordinator in a same time. But unfortunately, there are no guarantees on message passing order, and the recipients of these messages may give out different conclusion on which is the coordinator process. The condition may be broken if the assumed timeout values turn out to be accurate. That means if the processes failure detector is unreliable. Token Ring algorithm and Modified Token Ring algorithm Token Ring and Modified Token Ring algorithm are having very special routing. It is totally different with the Bully algorithm. They know the process next to them and just passing the message to the process which next to them. It is much more simple compare to other algorithm. They just need to take the information from beside, add the value and pass to another side. The message passing traffic is very much lower than other algorithms. This is because they just pass the information to the next process after that no more communicate with other processes. This reason make the algorithm become much easier to carry out. Compare with the bully algorithm which need keep communicate with all the process, Token Ring just need the message passing around the ring and know all the information about which one process having the higher numbered process. After that, the process can decide after compare and get the highest numbered process. Then, it just needs passing a decision message around the ring to announce or declare the leader in the ring. Meanwhile, the token ring and modified token ring also have their different. Token ring needs add up the information when the leader is crashed or down. Then the message or information will keep pass and to next process and the process will add its own ID into the message and passed to the process next to it. It will keep on going until the message reaches the process which starts the election process. Hence, the process will compare the information then announce the new leader by passing the coordinator message to the next process and keep on passing it in the ring. But the modified token ring will have slightly different. When the process notice the leader is crashed and start the election, the information message passing will start. When the message passing in the ring, it will compare the results collect from the processes. In the comparison, the highest numbered processs ID only will remain stay in the information message. Those smaller numbered processes ID will be deleted or will not be put inside the information message. When the information message finish a round, it will straight away start announce or pass the coordinator message to all the process for the new leader been selected. It is much easier and simple for the information message. All the comparison will be done when the new ID want to add into the information message. It not just save the time and no need wait until the end just compares the information that get from all processes. It also make the information message smaller and the message passing consumed less time to pass to the next process. The limitations for Token Ring and Modified Token Ring algorithm are they both also consumed a lot of time in message passing. It needs to pass and get the information message. It will take a round to get all the information. For those smaller processes, they also need to involve in the passing message process even they also would not been selected as a leader. It will take much more time compare with other algorithms. After the leader had been selected, the coordinator message also needs to pass around all the processes in the ring. The coordinator message will not pass to all the processes at once but it will pass from one to another one. All these processes really consumed and waste a lot of time compare with other algorithms. Besides above limitation, the message passing around the ring sometimes also will miss. When the information or coordinator message passing around the ring, it will possible loss or miss out. After that, it need take time to been noticed and regenerate the information message passing. Hence, the message needs to restart pass among the processes. This make the process for the election for leader consumed longer than other algorithms. Algorithms analysis In modified Bully Algorithm, if a single node detects the coordinator is crashed, N (i) with an order of O (n) is obtained as follows: The order of message passing increase to O(n2) with fault tolerance as follows: Where i is the selected leader ID number. The bully algorithm against the Modified Bully algorithm has been plots for the case when one node notices that the coordinator has crashed. From the graph, the traffic for the Bully algorithm from the beginning is much higher than modified Bully algorithm. Hence it keeps decrease when the process ID noticed increased. Meanwhile, the modified Bully algorithm is having a nearly constant for number of message passing. This shows that the traffic in the modified Bully algorithm is much less than Bully algorithm. That means modified Bully algorithm is better than Bully algorithm and has lower traffic flow when election happens. In Token Ring algorithm, the number of message passed with an order of O (n2) is: For the modified Token Ring algorithm is: The number of messages passed reduced and the complexity is much lower. From the graph above, the number of message passing in the ring for the Token Ring algorithm keep increase when the number of processes notices that the coordinator has crashed. But for the modified Token Ring algorithm, the number of message passing in the ring has not much different compare to non-modified. This shows that the traffic flow in the ring for modified ring is much lower than non modified. Conclusion Leader election algorithms play an important role in distributed system. The modified Bully algorithm and Modified Token Ring algorithm are efficient and easier to implement in all cases if compare to the existing one. But, still need a lot of improvement have to be done so that the algorithms can be more safety and efficient in the electing the coordinator in distributed system.

Monday, January 20, 2020

The General Electric Company Essay example -- Technology, Investment

The General Electric Company abbreviated as GE is among the main expanded technology, mass media and fiscal services corporations internationally. The headquarters is in a town known as Schenectady in New York and in Fairfield, CT. It functions via 11 core areas, they include GE Advanced Materials, GE Consumer & Industrial, GE Energy; GE Healthcare, GE Infrastructure, GE Transportation, NBC Universal (80 percent owned by GE), GE Commercial Finance, GE Consumer and GE Insurance. GE is a multinational and functions in in excess of 100 countries globally and makes roughly 45 percent of its incomes away from the US. Through the progress of its over 110 years of invention, GE has amassed in excess of 67,500 copyrights, and the company's scientists have been bestowed with two Nobel Prizes and several other honours. History The antiquity of the General Electric (GE) Company involves a noteworthy portion of the antiquity of technology within the borders of US. GE has progressed from the home laboratory belonging to Thomas Edison into one of the biggest corporations within the world, subsequent to the development of electrical technology from the humblest initial presentations into the 21st century ‘s high-tech sorcery. The corporation has correspondingly progressed into a corporation, with a cumulative move from technology to services, and with 11 main operating units. Swot analysis Strengths Universal acknowledgment: GE has invested in the world market therefore attaining universal acknowledgment for its exclusive merchandises. Forbes magazine, i... ...nal corporations, GE has to wrestle with such matters and manage them efficiently. Technological Analysis: Machinery in the contemporary world is progressing at an massive pace. Pioneering merchandises are constantly being familiarized utilizing technology that is more advanced every day. Older technology is subsequently being obsolete at an extremely elevated rate transversely all segments in the economy. Heading for exceeding competitors, several corporations have turned to novelty, research and expansion, which have resulted in upgraded heights of technology. The degree of technology progression internationally differs with each republic that GE has ventured into as they differ regarding resources accessibilities. Amongst the republics with the uppermost degree of technology progression is Japan and US in which GE has invested in (General Electric, 2009).

Saturday, January 11, 2020

Is Lying Bad?

Imagine the president of the United States telling everyone that if they spend all of their money until they go bankrupt, then the president will reimburse you, plus get an extra three million dollars. After everyone is totally bankrupt, they figure out that the president was lying and now there is an extremely slight chance that they will ever get their money back. Many people believe that lying is one of the worst things a person can do. They view it as something that hurts everyone and eventually destroys or consumes the person that lies. Others believe that lying can be the best way to handle a situation. They view it as protecting someone's feelings or calming a difficult situation. Many people in our lives share the belief that sometimes the truth isn't is everyone's best interest, but it should be. First and foremost, lying effects you extremely. If you tell a little white lie such as, â€Å"Does this dress make me look fat? † â€Å"No! â€Å", then you may have some guilt riding on your shoulders. If you tell a huge, important lie, then the guilt will be riding on your shoulders like a one thousand pound weight. For instance, what the president did. After a pointless lie, the whole nation is totally poor and most likely starved because of the lack of money for food and water. People lie everyday to, in someway or another, keep themselves out of trouble. Many teenagers will lie to their parents about what they are doing for the evening, how much of their homework they have done, or how that glass vase got broken while they were out of town. We even lie to our boyfriends or girlfriends about who that other boy was that called the house or what exactly we did with our friends last night. All anyone is trying to accomplish by this is to stay out of trouble when we know we've done wrong; but we never think of the effects of lying. Although we think we're being sly, parents are usually smarter than we give them credit for! Eventually there will be no point in telling this lie any longer because be then, everyone has already found out! Then the problem becomes the issue of trust. If you lie, there is no trust. That can be one of the serious consequences of lying. You should never have to lie, or deceive any one. Lies are empty. Evil is simply hurting yourself or others, and lies can do that, even when you don't think they are. Lying can also effect others in a negative way too. How about lying to impress other people? More common in children and teenagers, we lie to make others think we're cool, and when you really think about it, that's the part that's not cool! Most young people care too much about what others think about them. If you tell even the littlest lie, it will harm you in the long run. For instance, your friend asks you if you want to hang out or maybe do something. You say that you can't because you are too busy studying and drowning in school work. Even though, you are actually having the time of your life with some other friends at Golf World. About fifteen minutes late, you look towards the door and here comes your poor, lonely friend through the big glass doors. She spots you, stares sadly for a moment, and then leaves. That is all it takes. One small lie and there you go, one less trustworthy, good friend. To sum it all up, lying is always and entirely bad. Whether it is a small, white lie or a big, important lie it can still hurt you or someone else. Lying effects you in a negative way, making you carry guilt, losing trust, and lying for dumb reasons such as to impress others. Lying effects others in a negative way also, because others might think bad about them or you might just make them look ignorant. It is wrong because it is being deceitful to lie. White lies don't benefit anyone but the person lying. It makes them feel better because they don't want to confront the actual issue at hand. Imagine a world where no one ever told the truth. How would you ever find the truth? How would you deal with having to live in a life of lies? â€Å"Liars when they speak the truth are not believed. † —Aristotle. So why even lie at all?

Friday, January 3, 2020

Gangs of New York, an Example of Naturalism Essay - 839 Words

In the beginning, it seems unlikely that Gangs of New York will be an example of naturalism. Unlike To Build a Fire or Open Boat, the whole story of Gangs of New York happens in a civilized area, and nobody is in a case of danger because of the nature. Naturalism is implicit in this article. But being implicit does not mean it is ineffective. Instead, the idea of naturalism within this article is more confound than other two stories we studied before. The very first scene, a cave is hidden underneath a mission, somehow revealed the naturalist’s idea of brute within. Cave is a symbol of primitive, brute, and undeveloped. Mission is a symbol of civilized, peaceful, and developed. Another similar dramatic reminding of this idea is priest†¦show more content†¦This is proven by the canon firing. The canon hits whatever is in its way like the nature destroys whatever is in its way. Canon kills both the Dead Rabbits and Nativists. Before the indifference of the nature, fighters of both group started to help each other to get out of the filed. The most effective scene is the end of the story. Behind Vallon and Cutting’s graves, New York City evolves. As Amsterdam said, nobody is going to remember the fight between Dead Rabbit and Natives. Their story is like stories written on the beach, being washed away by the waves of history. Dead Rabbits, Nativist, Vallon, Cutting, Amsterdam, all their dreams, struggles, and ef forts will be concentrated into just a few words and written in the history book. Human can make little impact in the long history of the universe. The nature is indifferent toward Vallon and Cutting. Either group winning the war is not going to change the history. Unlike the two stories we read in class, everyone struggles for survival, the naturalism idea in the movie is represented by people’s lust and greed, the desire for dominance of pleasure. People do whatever possible to gain those things. Priest Vallon fights for the rights of immigrants. On the surface, he is a priest. But he would not mind killing someone to achieve his goal. The crucifix on the one hand is Vallon’s civilized side. But when civilized mean cannot achieve his goal, the other hand holding a knife isShow MoreRelatedAnalysis Of The Book Last Exit On Brooklyn By Hubert Selby Jr.1295 Words   |  6 Pagesactions change your fate. Much controversy is created involving this topic, especially in a unique literary text named Last Exit to Brooklyn by Hubert Selby Jr. This novel consists of six short stories taking place in the slums of lower-class Brooklyn, New York throughout the 1950’s. This novel has aroused much controversy because of Selby’s blunt style of writing involving drugs, sex, prostitution, and violence. Many readers found the novel offensive during the time it was published because they worriedRead MoreEssay about Stephen Crane the Naturalist2093 Words   |  9 Pages Stephen Crane the Naturalist Stephen Crane (1871-1900), the naturalism, American writer. Stephen Crane was well known for his naturalist style during his time. Naturalism in literature was a philosophy used by writers to describe humans in regards to the influences and interactions within their own environments. The characters described in the naturalist literatures were usually in dire surroundings and often from the middle to lower classes. Despite their circumstances however, humans withinRead MoreWhat Are The Key Principles That Underpin Individual And Social Positivism? Essay1892 Words   |  8 Pages1996, 2000). Modern criminology with rational system of control; where the rule of law based on the belief people exercise choice. â€Å"The ethos of productivity was rejected in the age society of leisure. Mind expanding drugs, permissive sexuality, the new rock music transcendental poetry all articulated the peaceful principles of a ‘flower power’ whose opposition was committedly non-violent † (Sumner, 1994:200). As the period of 1945-1980s focused on problems of challenging power of the state, civilRead MoreAfrican American Culture in a Modern American Dominant Sociology2841 Words   |  12 Pagesattempting to strip them of their African culture. The physical isolation and societal marginalization of African slaves and later of their free progeny however facilitated the retention of significant elements of traditional culture among Africans in the New World generally, and in the U.S. in particular. Slave owners deliberately tried to repress independent political or cultural organization in order to deal with the many slave rebellions or acts of resistance that took place in the southern United States