gpt4 book ai didi

python-3.x - 多处理 Pipe() 包装器损坏 : Something is Hanging. V5

转载 作者:行者123 更新时间:2023-12-03 07:39:16 25 4
gpt4 key购买 nike

增强型 Python 多处理数据管道包装器

这是目标...

目标

这是我正在进行的一个大项目的一部分。这是一个重要的部分,它将大大简化我程序中的报告传输。该程序针对数百万个输入测试功能,并使用多处理来加快速度。 Source code on Pastebin .

目标和 yield

简单地说,multiprocessing.Pipe() 是不够的。它应该能够处理大量字符串并在发送方和接收方之间切换流程执行。我写这个来实现:

  • 自动错误处理
  • 传输错误分类
  • 数据传输分块和重组
  • 无限数据传输大小
  • 进程同步
  • 简单抽象以增强可用性

问题

It has a weird bug I can't find. Days and plenty of documentation later, it's not fixed. I've left in a good many debug lines. Try entering "hi": you don't see "Receiver.Test: Output: hi" but should. Try a second time, it just hangs: Sample output.

由一位亲爱的 friend 修复。

测试

GPE 有效。这两个前两个测试都有效。对于测试 1,这 source code输出 these results正确和一致。对于测试 2,这 source code输出类似 these results 的内容正确。对于测试 3,这 source code输出类似 these results 的内容正确。

拜托!

It's time to ask for help. It is part of a larger project. To be fair, there are a good many lines of code. This should be part of the multiprocessing module. I'm humbled. Can someone tell me what up? PLEASE? ANYONE??

没有人回答...

最佳答案

问题

receive_oscillate 中,yield from 看起来永远不会清除。

注意事项

此外,深度嵌套的函数和单行复合条件对于 Python 来说并不是特有的。此外,分解深度嵌套的函数并添加自动化单元测试将有助于减少错误并促进维护。

关于python-3.x - 多处理 Pipe() 包装器损坏 : Something is Hanging. V5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63680195/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com