The Art of Software Thermal Management for Embedded Systems