title: Dynamic limitation of concurrent tasks
body: <p>Is there a type for this example, such as TaskScheduler or some other type with which I could dynamically change the number of tasks being executed in parallel? I just need a yes or no answer, if yes, which one. It is necessary only for the example below.</p>
  <pre><code>using System.Threading;
  using System.Threading.Tasks;
  
  namespace ConsoleApp1
  {
      internal class Program
      {
          static void Main(string[] args)
          {
              Task[] tasks = new Task[100000]; 
  
              for (int i = 0; i &lt; tasks.Length; i++)
              {
                  tasks[i] = Task.Run(() =&gt; Thread.Sleep(10000));
              }
  
              Task.WaitAll(tasks);
          }
      }
  }
  </code></pre>