How to set Python multiprocessing pickle protocol

2019-07-14 12:31发布

I am trying to establish really basic string-message IPC (no need for objects or anything fancy like that) between two Python processes on the same machine, the listener in Py2 and the client in Py3. This doesn't work out of the box because Py3 MP defaults to Pickle protocol 3, which doesn't exist for the Py2 listener, so the listener crashes on an unrecognized pickle protocol. I wish MP wouldn't pickle at all, I'm just sending strings over the wire and don't see why I should be forced to go through a Pickling step if I choose not to, but if I can't turn pickling off entirely, then how to I tell the client in Py3 to use pickle protocol 0 (or 1 or 2)? I have looked for a solution to this seemingly straightforward question and cannot find an answer, much to my astonishment.

Thank you.

0条回答
登录 后发表回答