def solve_tasks(self):
        """
        Launch all tasks and grab results
        """
        done = 0
        stop = 0
        for task in self.tasks:
            stop+=1
            try:
                task.start()
                if stop==self.limit:
                    for t in range(stop):
                        task = self.tasks[t+done]
                        task.join()
                        self.result.append(task.result)
                        del task
                    done += stop
                    stop=0
            except Exception:
                print 'Unable to launch thread #%d' % (stop+done)

        if stop>0:
            for t in range(stop):
                task = self.tasks[t+done]
                task.join()
                self.result.append(task.result)
                del task
dataset/ETHPy150Open sysdream/pysqli/pysqli/core/async.py/AsyncPool.solve_tasks/original