Simplify threading interface to tasks and threads