Thread initial point.
While there are tasks to be done, runs them.
The thread dies as soon as there is nothing waiting to be
while (len(self.waiting) > 0):
id, hook, parameters, input_files = self.waiting
self.running[id] = True
ret_code, output_files = hook.run_job(parameters, input_files)
self.done[id] = ret_code, output_files
self.cores_used -= 1