Pages

Saturday, June 30, 2012

3...2...1...1... Happy Leap Second (and a merry Linux to all)!

Jump!

Science is awesome, and so is time. With the advent of better measurement devices, such as clocks, humans are able to calculate the time it takes for one day on earth to occur with the utmost precision. This time is known as the mean solar time, and our best representation of this is represented by the Coordinated Universal Time (UTC) measurement [1]. This measurement standard defines a common frame of reference for which the world can tick off of. Effectively, every time zone is +/- so many hours with respect to UTC. As technology has progressed, so has the capability for man to more accurately measure the length of a day. In fact, a day from the perspective of a mean solar day lasts 86,400 seconds. The second is a unit of measure in the International System of Units (SI) which the world recognizes for maintaining the definitions of weights and measures. The SI value for a second is defined as being "the duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom" [2]. In other words, an atomic clock based on atoms jumping around, and a counter to count these jumps, can be used to measure the duration of a second, and can be further used to measure the length of a day.

This awesome precision in measuring time is so accurate that we now can measure very small amounts of error between our actual astronomical day (mean solar day) and the clock. How do we account for such discrepancies, despite how small, between the astronomical universe, and our very earthly clocks? ... wait for it... wait for it... in the name of Van Halen I proclaim Jump seconds... err I mean "Leap Seconds." Every so often, and it does not appear to be periodic, we can either add or subtract twice a year a leap second from our clocks. This does not occur every year, see the chart linked here [1], but it can occur twice, or at least, it has once before. Scientists determine when a leap second should occur, and then they insert these puppies to the UTC representation of time at June 30th and/or on December 31st. If the choice is to add a second, then the time on one of the chosen dates will be 23:59:60 (not 23:59:59 marking the end of a normal non-leap-second-day). If the choice is to remove a second, then the removal will be 23:59:58 ending the day. Pretty sweet huh? These announcements for leap seconds are made by the International Earth Rotation and Reference Systems Service (IERS). The most recent update can be found here.

Shootin' off a Leap Second and Linux

So, now you might just be saying: "Sweetness so these French dudes choose when to mess with our clocks." Well, shall I clarify, nicely pamper our clocks so that they become more accurate to the ever pulsating state of our universe, e.g. make more accurate. Anyways, I've been a Linux guy for years, and I do occasionally like to know how things work. How does this magic in the box (GNU/Linux) handle this second bumping? Well, it is all handled as a tightly coupled dance between the userland NTP daemon and the Linux kernel. Upon boot, the Linux kernel registers a high resolution timer (hrtimer) to trigger the insert/removal of a leap second if needed. This acts like a loaded gun. The NTP daemon, which runs in userland, is responsible for detecting either through the 'leap indicator' flag in the NTP packet from a high-stratum NTP server or from a data file that specifies leap seconds. Since leap seconds are announced 6 months in advance of the event [6], it should be no surprise. Further, the leap indicator sent in an NTP packet is a warning from a higher-stratum server to its peers saying that "Hey guys... we got a leap second on the way at the end of the current month" [5]. On the day that the leap second is to occur, the communication between userland and Linux kernel happens with the daemon telling the kernel about the nature of the leap second (either to add or remove one). The method of dispatch is the 'adjtimex' system call which the userland daemon passes information to the NTP code in the kernel. This will trigger the hrtimer to add or remove a leap second at the end of the day. So, the kernel basically will start its timer, the loaded gun that has been waiting since boot, and set it to go off at the end of the day. And when that occurs.... *bang* leap second goodness! Oh, and the next leap second is just in a few hours June 30 at 23:59:60. Careful readers will remember that such notation means we are adding a second. So sleep in my friends!

-Matt

References

Wednesday, June 20, 2012

Pics from Beijing

So I avoided using Flickr, and went straight ahead and dropped my Beijing pics into a Picasa album. Check 'em out here!

-Matt

Monday, June 18, 2012

Back in the Melbourne Again

Just got back from Beijing! Clothes in the laundry, and shower taken. On the way back, I sat nice to a Shaolin Monk. Guy seemed really intelligent and nice. He had a smart phone, and one of his disciple's on board.

-Matt

Thursday, June 14, 2012

What did I do Thursday?

I just got back from seeing the Great Wall. That was way exhausting, seriously steep stairs... and lots of people. Apparently pushing and "coughing-up" phlegm is normal here. We then went to a jade factory, saw some live carving, and then had a nice (was told it was Matt-friendly) food. Anyways, we then went to Tienanmen Square, and walked across the way and through the Forbidden City. We then stopped into a silk factory, which was neat, but it was pretty much like the jade place, a sales pitch. The weather was way awesome, but the sun will suck the energy right out of ya! The guide said it was probably the best day in the 9 years he has been working the tour. Anyways. I just got home and "unloaded" kinda scared now. I gotta call housekeeping, that gand triple-ply isn't easy-flush.

-Matt

So what did I do Tuesday?

Just met Hans Boehm and Doug Lea. Just sayin' :-) I do have pics. I chatted some camera stuff with Boehm, and joked on a programming language with Lea. Very very nice people!

-Matt

Sunday, June 10, 2012

First Day In China

Went to Wal-Mart! Ok, well, I am a bit scared being vegan and eating out. I have done it a few times already here but I can pretty much guarantee my last meal had some meat stock. I printed out notes saying no meat/fish/oyster/etc etc etc. (Yes, fish is meat and so are oysters). Anyways. I really am finding people looking at me weirdly. Very very very very few people understand English well or at all. I am really surprised. But, earlier, I met one really nice kid who helped me order. We spent ages! He took me to a restaurant, sat down, and helped. I tried to give him a few Yuan, but he turned it down. Just wanted to meet me again. That was really humbling.

So what else? Well, I met a few really nice people at the airport. I must say, the hotel is pretty slick. Looks nice, goldfish throughout the hall, Chinese art. Pretty neat. But... I still haven't had a real cup of coffee in a while, the one at Melbourne airport was frikkin' awesome!

And I've already stopped up the toilet once! Triple-ply. I was counting them layers as I was doin my business. I haven't had much sleep either.

Much love from the Northern Hemisphere!

-Matt

Friday, June 8, 2012

To Beijing?

So, a paper myself and advisers have been working on, "Towards Region-Based Memory Management for Go" was accepted to the "Memory Systems Performance and Correctness (MSPC) workshop (See Session 3). I also have a "ticket" to Programming Language Design and Implementation (PLDI) conference. I have been pretty up/down about being vegan and going. But, well, anyways... I am to leave tomorrow to go to China (about a 12 hour flight). Kinda nervous. Anyways, I'll try to take pictures, but I might not be able to upload them (due to not having a mini-B USB cable or proper SD-reader). But, I'll be in China, I should be able to find one of them some where!
Much love and peace, and Slayer!
-Matt