title: Using TPL to do some "Jobs"
body: <p>I'm starting a little "job manager", it will execute some "Job" object implement an "IJob" method. Every IJob finish by returning a potential list of new jobs.</p>
  
  <p>All my jobs are stored in a Queue, which is accessed thread-safely, and when I finish a Job, I add to this queue new queried jobs.</p>
  
  <p>I'm searching how to parallelize this with the TPL.</p>
  
  <p>I've several ideas, but none of them are valid due to my constraints, which are:</p>
  
  <ul>
  <li>I need to limit the number of thread(let's say to 4), because some request are quering a website, which doesn't allow more than 4 simultaneous requests(I think I can manage this with a semaphore)</li>
  <li>My list of jobs will change, so I just cannot launch 4 thread, divide the number of jobs by the number of thread, and every thread runs his stack of job.</li>
  <li>Maybe sometimes, if I've 4 thread, I've only one job more, but I can't let stop other thread, because maybe the last job I've to run will create a lot of more jobs.</li>
  </ul>
  
  <p>Thank you very much!</p>