Currently, threading.Thread requires that group=None pending implementation of a ThreadGroup class such as that described in http://www.javaworld.com/article/2074481
This has been an open todo for very long time, possibly because it may be too big of a task to implement all the features including subgroups.
I think we can implement a small but useful set of features without too much difficultly:
path_explorers = threading.ThreadGroup('path_explorers')
for path in paths:
threading.Thread(path_explorers, explore, (path,))
for thread in path_explorers: # enumerate unfinished explorers
print(thread)
path_explorers.start() # begin parallel search
path_explorers.join() # wait for group to finish
print("Result:", best_path) |