Improving The Efficiency Of Parallel Applications On Multithreaded And Multicore Systems