Sleeping threads to increase cpu efficiency