Temperature- and Energy-Constrained Scheduling