1
私はプールでmultiThreadedを作成したいと思う機能を持っています。クラスとメンバ関数のリストを持つThreadPool
def find(item):
curve=Curve(item)
return curve._find()
入力がリストである場合にマルチスレッドのバージョンがチェックwouuld:上記のように、私はクラスのリストでpool.mapを呼び出すことができますどのように
def find(item):
if type(item) == list:
items=item
pool = ThreadPool(len(items))
curves = pool.map(Curve, moniker)
pool.close()
pool = ThreadPool(len(items))
# now comes the tricky part:
results = pool.map(???) # curves is a list of class
# with each having _find as a function
pool.close()
return results
else:
curve=Curve(item)
return curve._find()
?