Improved efficiency of thread_P for StateP