Factory.StartNew
is not only creating the task, but it is also running it.
You don't even need to create a task, just invoke calc
inside the ForEach
loop.
You actually need to create the task without running it
Task<double> x = new Task<double>(() => Tree.calc0(features));
And then start the action on the Parallel.ForEach
.