import threading

class Task:
    @staticmethod
    def run_mt(task_method, cluster, num_threads):
        threads = []
        for i in range(num_threads):
            thread = threading.Thread(target=task_method, args=(cluster, num_threads, i))
            thread.start()
            threads.append(thread)

        for t in threads:
            t.join()

    @staticmethod
    def run(task_method, cluster):
        task_method(cluster)