p_maxthrwaits should go away. It is ok to do the wakeup everytime you transition from p_numthreads == max_threads_per_proc to p_numthreads == max_threads_per_proc - 1. p_profthreads also seems like overkill but I don't have anything to suggest at the moment.