The Atacama Large Millimeter Array (ALMA) is an international telescope project currently under construction in the Atacama desert of Chile. It has a provision for 64 antennas of 12m each, arranged over a geographical area of a few square kilometers. Antenna control and correlated data acquisition is implemented by means of a distributed set of realtime Linux computers, each one hosting ALMA Common Software (ACS) based applications and connected to a common time base distributed by the ALMA Master Clock as a 48ms electronic pulse signal (time event). All these computers require to be time synchronized for achieving coordination between commands and data acquisition. For this purpose, the ArrayTime system presented here implements a real-time software facility that makes possible to
unambiguously time-stamp each time event arriving at each computer node (distributed clock), relative to an external time source of 1Hz and in phase to the TAI second. Array time is the absolute time of each time event, and synchronization of distributed clocks is resolved by communicating the array time, via ACS services, for the next time event interrupt at least once during the operational cycle of the distributed clock. Thereafter, it is possible to schedule
application tasks within a latency range of 100us by extrapolating from the last interrupt and based on the current CPU Time Stamp Counter (TSC) and the estimated frequency of the CPU clock. In the following, we present a description of the elements that constitute the ArrayTime facility.