且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

multiprocessing.Process子类可在Linux上运行,但不适用于Windows

更新时间:2023-11-13 11:24:52

您的Updater类具有成员screen,该成员本身具有成员process,该成员接收multiprocessing.current_process()的值.

Your Updater class has a member screen, which itself has a member process which receives the value of multiprocessing.current_process().

当您调用updater.start()时,它将尝试使更新程序腌制.这仅在Windows上发生,因为Linux使用fork()而不是酸洗.但是,不能对当前进程对象进行腌制,并且会引发异常.

When you call updater.start(), it tries to pickle the updater. This only happens on Windows because Linux uses fork() instead of pickling. However, the current-process object cannot be pickled and the exception is raised.

要解决此问题,您可以删除process成员.

To fix this, you can remove the process member.