| 856 | |
| 857 | |
| 858 | def RunMultiThreaded(infos_to_run, status, options, variables): |
| 859 | pool = multiprocessing.Pool(options.jobs) |
| 860 | try: |
| 861 | results = [(info, pool.apply_async(RunTest, (info, options, variables))) |
| 862 | for info in infos_to_run] |
| 863 | while results: |
| 864 | new_results = [] |
| 865 | for info, result in results: |
| 866 | if result.ready(): |
| 867 | HandleTestResult(status, info, result.get(0), options.rebase) |
| 868 | else: |
| 869 | new_results.append((info, result)) |
| 870 | time.sleep(0.01) |
| 871 | results = new_results |
| 872 | pool.close() |
| 873 | finally: |
| 874 | pool.terminate() |
| 875 | pool.join() |
| 876 | |
| 877 | |
| 878 | def RunSingleThreaded(infos_to_run, status, options, variables): |