Some elaboration on the plated threads issue mentioned by stookeyfpe. Cadmium's advantage over zinc is in moist or corrosive conditions. The corrosion of zinc-plated threads creates such a volume of zinc hydroxide that the fastener is effectively cemented in place that the steel bolt (capscrew) may snap when trying to unscrew. The same thing happens with a steel bolt in aluminum -- aluminum corrosion seizes the bolt so tightly that it will break when trying to undo. Cadmium's corrosion product is weak & doesn't cause problem --that is the main reason it is used on critical aircraft applications.
Having said all that, note that hot-dip galvanizing may outlast cadmium plating simply because the galvanizing may be 3-8 times thicker. In the links given by cdafd, the comparison is with electroplated zinc -- typically much thinner than galvanized. In Phoenix, galvanized life indoors may be 300 years vs. 50 for cadmium.
But, the major problem with cadmium is toxicity -- it is already banned from automobiles, electronics & government proects (except for a few critical exclusions, mostly on aircraft). Any employee handling camium plated parts must wear gloves (which should be kept segregated), and you must avoid creating vapor or dust (no welding or brazing, limited soldering, no abrasive blasting, limited machining, etc.). So, EPA, OSHA, European Union, China, California, etc. have restrictions.