Python 多进程的tqdm进度条问题:apply_async正常,为什么map_async的回调函数无效呢?

pool = Pool()
pbar = tqdm(total=len(aids))
def update(*a):
    pbar.update()
pool.map_async(datafunc, aids, callback=update)

程序在跑,但进度条不动

img

for i in aids:
    pool.apply_async(datafunc, args=(i,), callback=update)

程序在跑,进度条也在动

img

求解~

你好,我是有问必答小助手,非常抱歉,本次您提出的有问必答问题,技术专家团超时未为您做出解答


本次提问扣除的有问必答次数,将会以问答VIP体验卡(1次有问必答机会、商城购买实体图书享受95折优惠)的形式为您补发到账户。


因为有问必答VIP体验卡有效期仅有1天,您在需要使用的时候【私信】联系我,我会为您补发。