Chapter 3: Time Flashcards
1
Q
Real time clock (RTC)
A
- RTC continuously ticks even when the PC is hibernated or switched off
- Based on alternative power source Referred to as “wall clock” time
- Should not be confused with system clock * Should not be confused with real‐time computing
2
Q
Measuring time: System clock NN
A
time_t time(time_t * t) Returns the time in number of seconds since 1970‐01‐01
3
Q
CPU time NN
A
- Time the program spent on the processor
- Processes & threads can be preempted
- According to process, schedule and priorities
4
Q
Unix millennium bug - The Y2038 problem
A
Affects software and systems that:
- store system time as a signed 32‐bit integer and
- interpret this number as the number of seconds since Thursday, January 1st, 1970
- Represents time until 03:14:07 UTC on Tuesday, January 19th, 2038
- Times beyond “wrap around” & are stored internally as a negative number (int overflow)
- Systems interpret as a date in 1901 rather than 2038!
- Today, affects programs working with future dates (does this matter? 2038?)
5
Q
Other vulnerable systems & expected surprises
A
Embedded systems
- Telecommunication systems
- Transportation systems
- Flight, automobiles, …. ABS, tracking control, parking aids, …
- As of 2011, most embedded systems use 8‐bit or 16‐bit microprocessors! Y 24 Problem ) more frequently ( sweet
- While our desktops are transitioning to 64‐bit systems
6
Q
Coordinated universal time (UTC)
A
- Universal
- Usable everywhere in the world
- Independent from time zones
- Converted to local time by adding/subtracting local time zone Coordinated ( = derives from estimtes)
- Several institutions contribute their estimates of current time
- UTC is built by combining these estimatesUTCbased on International Atomic Time (TAI): Time standard based on “average” of signals from400 atomic clocks worldwide
7
Q
From GMT & TAI to UTC
A
- Observatory in Greenwich derived GMT from astronomical events like the solar day
- UTC is based on a quantum resonance of a caesium atom (therefore, more accurate)
- Atomic second is number of transitions of Caesium 133 atom defined based on mean solar second in its year of introduction
- Caesium clocks around the world report the number of ticks of their clocks to standard body in Paris
- Thus, International Atomic Time (TAI) is derived (mean number of ticks of caesium atom 133 since 1.1.1958)
8
Q
From GMT to UTC NN
A
- Today, 86400 TAI seconds about 3 ms less than a mean solar day
- 86400 TAI seconds per day vs. change in rotation of earth would eventually have midnight fall in the middle of the day To prevent this, extra seconds are added or removed inside the TAI time‐scale to keep synchronized with GMT
- TAI seconds are constant, leap seconds keep time scales in sync. (atomic vs. solar), giving rise to UTC
- Up to and including 2012, total of 26 leap seconds have been added (most recently on June 30th, 2015)
9
Q
Leap second NN
A
- During a leap second, either one second is removed from day, or a second is added Happens at the end of the UTC day
- If a leap second is added, time in UTC is specified as 23:59:60, i.e., two seconds from 23:59:59 to 0:00:00 instead of one
- If a leap second is deleted, time jumps from 23:59:58 to 0:00:00 in one second instead of two
10
Q
Notions of time
A
- Time seen by an external observer
- Global clock of perfect accuracy Time seen on clocks of individual nodes – Each has its own clock
- Clocks may drift out of sync Logical notion of time
- Ordering of events and causality
- Based on information flow about those events
11
Q
Global clock: External time reference
A
- The “gold standard” against which many protocols are defined Not implementable Use of external time is risky
- Many protocols that seek to provide properties defined by external observers are extremely costly
- Are unable to cope with failures of the synchronization system
12
Q
Time seen on internal clocks
A
- Most computers have reasonable clocks Clock skew: Instantaneous difference between readings of two clocks
- Clock drift: Rate at which skew increases between a clock and some standard /Rate of change do they separate
- 10‐6 sec/sec for quartz oscillator about 4 ms/hour or 1 sec per 11.6 days
13
Q
Clock synchronization
A
- Mechanisms to get clocks on different processors to agree on time
- An example of a distributed agreement protocol “Time” is a universal synchronization mechanism Having synchronized clocks makes many things easier
- Debugging events in a log
- Email messages and threads of emails on mailing list
- A common point of reference
14
Q
Synchronized time: Systems need it!
A
- Stock market sale and buy orders and confirmation timestamps
- Network fault isolation, reporting and restore
- Network monitoring, measurement and control
- Distributed multimedia stream synchronization
- Experiment setup, measurement and control
- Cryptographic key management and lifetime control
15
Q
Clock synchronization mechanisms
A
- Hardware support: Radio receivers, GPS receivers, atomic clocks, shared backplane signals
- Tight synchronization
- Negligible overhead
- Costly (can’t equip every computer with an atomic clock)
- Not possible for all configurations
16
Q
Hardware clock synchronization
A
- Global positioning system (GPS)
- Broadcast signals via radio waves Backplanes and buses
- Synchronization among processors in chassis
- Tight bounds are possible