Chip multiprocessors (CMPs) allow thread level parallelism, thus increasing performance. However, this comes with the cost of temperature problem. CMPs require more power, creating non uniform power map and hotspots. Aiming at this problem, a thread scheduling algorithm, the greedy scheduling algorithm, was proposed to reduce the thermal emergencies and to improve the throughput. The greedy scheduling algorithm was implemented in the Linux kernel on Intel's Quad-Core system. The experimental results show that the greedy scheduling algorithm can reduce 9.6%−78.5% of the hardware dynamic thermal management (DTM) in various combinations of workloads, and has an average of 5.2% and up to 9.7% throughput higher than the Linux standard scheduler.