Optimizing energy consumption and application performance in a multi-core multi-threaded processor system