Message371146
I get unexpected behavior from Condition when using a Manager. I expected that if I call Condition.acquire() in one thread (or process) and then call .acquire() if another thread (or process) without first releasing the condition that it should block. However it seems like Condition.acquire() never blocks...
from multiprocessing import Pool,Manager
import time
def f(x):
cv,t=x
cv.acquire()
print(t,"Got cv")
return
if __name__ == '__main__':
m=Manager()
cv=m.Condition(m.RLock())
p = Pool(5)
print(p.map(f, [ (cv,x) for x in range(10) ])) |
|
Date |
User |
Action |
Args |
2020-06-10 00:09:43 | Misko Dzamba | set | recipients:
+ Misko Dzamba |
2020-06-10 00:09:42 | Misko Dzamba | set | messageid: <1591747783.0.0.431376232538.issue40934@roundup.psfhosted.org> |
2020-06-10 00:09:42 | Misko Dzamba | link | issue40934 messages |
2020-06-10 00:09:41 | Misko Dzamba | create | |
|