On the Connections between Thermodynamics and General Relativity