Hydrothermal unit commitment is studied using a formulation which employs the unit commitment risk as a reliability constraint. This approach provides a rational modeling of the problem by considering the outages of thermal units and the uncertainty of the demand. Thermal unit commitment is optimized by using dynamic programming. The calculation of the expected cost of thermal generation and the evaluation of commitment risk are performed by the segmentation method. For hydrothermal coordination, an expected incremental cost grid of thermal generation is constructed for different levels of hydro generating capacity by introducing a new algorithm which supplements the segmentation method with an efficient shifting technique. The gradient method is then applied to use this grid in the optimal dispatch of hydro units. The global optimization is executed in an iterative loop which consists of the thermal unit commitment and hydrothermal coordination