Thermodynamics and dynamics of a 1-D gravitational system