消息 [342319]
As Victor said, the `time.sleep(1.0)` might lead to Heisen failures. I am not sure how to write proper strong synchronization in this case but we could instead go for something intermediate such as the following pattern:
...
p.terminate()
p.wait()
for i in range(60):
try:
shared_memory.SharedMemory(name, create=False)
except FileNotFoundError:
# the OS successfully collected the segment as expected
break
time.sleep(1.0) # wait for the OS to collect the segment
else:
raise AssertionError(f"Failed to collect shared_memory segment {name}")
What do you think? |
|
| 日期 |
用户 |
动作 |
参数 |
| 2019-05-13 12:50:35 | Olivier.Grisel | 修改 | recipients:
+ Olivier.Grisel, pitrou, vstinner, pablogsal, xtreak, pierreglaser |
| 2019-05-13 12:50:35 | Olivier.Grisel | 修改 | messageid: <1557751835.55.0.780755595425.issue36867@roundup.psfhosted.org> |
| 2019-05-13 12:50:35 | Olivier.Grisel | 链接 | issue36867 messages |
| 2019-05-13 12:50:35 | Olivier.Grisel | 创建 | |
|