Implementation of a simple task scheduler. It can run taks in parallel.