TasksManager modifications

Adding support for "less than cpu number"