2lamport - Synchronization in Distributed Systems In a...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Synchronization in Distributed Systems In a single CPU system, critical regions, mutual exclusion and other synchronization problems are generally solved using methods such as semaphores and monitors and highly rely on shared memory. Not true for distributed systems. Even the simplest thing such as determining whether event A happened before or after event B require careful thought. Clock Synchronization : In general, distributed algorithms have the following properties: The relevant info. is scattered among multiple machines Processes make decisions based on local info. A single point of failure in the system should be avoided No common clock or other precise global time source exists.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Clock Synchronization In a centralized system, time is unambiguous. A process will make a system call and the kernel will tell it the time. If process A asks for a time, and then a little later process B asks for the time, the value that B gets will be higher than or possibly equal to the value A got. Let’s use the program make as an example: Normally, in UNIX, large program is splitted into multiple sources files, so that a change to one source file only requires one file to be re-compiled. The way make works is simple, it just check the .o file with the .c (source) file. From the time the files are last modified, make knows which source files have to re-compile again. In the following scenario, the newly modified output.c will not be re-compiled by the make program because of a slightly slower clock on the editor’s machine. Computer on which compiler runs 2144 output.o created 2145 2146 2147 2148 Time according to local clock Computer on which editor runs 2142 output.c modified 2143 2144 2145 2146 Time according to local clock
Background image of page 2
Logical Clocks Every computer has a local clock -- a timer is more appropriate. A timer is usually a precisely machined quartz crystal. When kept under tension, quartz crystals oscillate at a well-defined frequency that depends on the kind of crystal, how it is cut, and the amount of tension. Associated with each crystal are two registers, a counter and a holding register. Each oscillation of the crystal decrements the counter by one. When the counter reach zero, an interrupt is generated and the counter is reload from the holding register. Each interrupt is called a clock tick. For PC, the clock ticks are 54.9 msec apart (18.3 per second)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 11

2lamport - Synchronization in Distributed Systems In a...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online