Xref: utzoo comp.arch:3883 comp.dcom.lans:1116 Path: utzoo!mnetor!uunet!husc6!ut-sally!nather From: nather@ut-sally.UUCP (Ed Nather) Newsgroups: comp.arch,comp.dcom.lans Subject: Re: Time synchronization in a Distributed Environment Message-ID: <10638@ut-sally.UUCP> Date: 10 Mar 88 22:08:42 GMT References: <1571@ogcvax.UUCP> <276@fallst.UUCP> Organization: U. Texas CS Dept., Austin, Texas Lines: 37 Summary: Another way ... > > In article aws@druhi.ATT.COM (SteereA) writes: > > Hi, > > I am looking for articles, references, implementations, > > etc. for solving the problem of keeping N machines within > > a specified time of one another. I appreciate any and all > > pointers. > > I recently faced the problem of keeping the internal CPU clock in an IBM PC in step with a more accurate clock located in an interface card. The interface sends a data burst once per second though the serial port. I used the arrival of the first byte as a time tick. The IBM PC keeps internal time by counting down its instruction clock frequency and it is possible to modify the value of the countdown if the timer interrupt is intercepted. No integer value of the countdown will give precisely 1 ms time ticks, which was needed for this application, so I alternate between one slightly too large, and one slightly too small. The amount of time each countdown value remains active is adjusted by watching for drift between the two clocks; a pair of countdowns is averaged about every 90 sec, and any drift is noted (and the CPU clock is forced back into phase at the same time). After about 10 cycles, the accumulated drift is used to adjust the amount of time each countdown value is used for the next 10 cycles. This constitutes a software servo that works quite well with all the PCs tested. Their instruction clock frequencies are quite different from one to the next, but the servo locks in after the first frequency change and stays locked thereafter. Details at eleven ... -- Ed Nather Astronomy Dept, U of Texas @ Austin {allegra,ihnp4}!{noao,ut-sally}!utastro!nather nather@astro.AS.UTEXAS.EDU