title: Managing multi-threading in C# .NET, controlling thread count per operation
body: <p>Think the title I've given is a bit confusing but hard to express what I'm trying to ask. </p>
  
  <p>Basically I am writing a program in C# using .NET that uses the Google cloud API in order to upload data. </p>
  
  <p>I am trying to do this in an efficient way and have used parallel.foreach with success but I need finer control. I collect the files to be uploaded into one list, which I want to sort by file size and then split into say 3 equally sized (in terms of gigabytes not file count) lists. </p>
  
  <p>One of these lists will contain say a third in terms of total upload size but be comprised of the largest files (in gigabytes) but therefore the smallest count of files, the next list will be the same total gigabytes as the first list but be comprised of a greater number of smaller files and finally the last list will be comprised of many many small files but should also total the same size as the other sub lists. </p>
  
  <p>I then want to assign a set number of threads to the upload process. (e.g. I want the largest file list to have 5 threads assigned, the middle to have 3 and the small file list to have only 2 thread.) Is it possible to set up these 3 lists to be iterated over in parallel, while controlling how many threads are allocated? </p>
  
  <p>What is the best method to do so? </p>