Tuesday, January 24, 2006

Year 2038

just browse the web and found that the year 2038 problem...

from http://www.dewtronics.com/msdn_090798a.html

How Many GUIDs, Again?

Henrik Vallgren and Peter Schaeffer took the time to let Dr. GUI know that he's dead wrong about there being enough GUIDs for each atom in the universe to have its very own. The number of particles (not atoms) in the universe is somewhere around 1079 or so—even Dr. GUI isn't sure of exactly how many.

A GUID comprises 128 bits, so the number of GUIDs is 2128. That's only about 1038, or 100,000,000,000,000,000,000,000,000,000,000,000,000. And that's a factor of 1041 short of 1079. So a GUID could hold a unique number for only 1 out of every 1041 particles in the universe. Thankfully, each particle doesn't need its own interface ID and/or class ID. (IElectron? IQuark?) So there are still plenty of GUIDs for our uses.

Henrik's line of reasoning was especially interesting:

"Consider the sun's mass 2*10^30 kg. Assume that the sun consists of only hydrogen. One gram of hydrogen is 6*10^23 (Avogadro's number) atoms, one kilogram 6*10^26 atoms.

"The number of atoms in the suns is thus approximately 10^54 (~2^179).

"The hydrogen assumption is wrong so that number should be divided by the true average atomic weight, of which I have no idea. [But it's certainly less than 100—perhaps less than 10—so the assumption of a pure hydrogen sun doesn't affect these numbers much. Like a factor of 100 isn't much.—Dr. GUI]

Then consider billions and billions of stars in the Milky Way. And quite a few galaxies on top of that. You'll get the picture ... "

Indeed, the good doctor does get the picture. Dr. GUI begs your forgiveness 1041 times.

Note that if the GUIDs were somewhat bigger, they WOULD be big enough to give each particle its very own GUID, or PID (for particle ID). It would take about 264 bits—33 bytes for each GUID.

Thanks again to Henrik and Peter for taking the time to write.

No comments: