Does a C# Task run on one core?

c#, parallel-processing, task-parallel-library

Solution

A task executes on a thread. The OS schedules threads to cores. Cores are a logical concept and different from physical CPU chips.

Create `Environment.ProcessorCount` tasks, or better use one of the higher level TPL constructs like PLINQ or `Parallel` .

Problem

Does a C# Task run on one core? I have a project where I need to decide how many Tasks to create. I need to create as many, as the computer can take. Is that the number of processors, cores, or logical processors, I am confused between the three options.

Original source