Anatoly <[email protected]> added the comment: It looks like multiprocessing.reduction is an undocumented module in Python 2.x. But people use it.
I should explain why I need it. When I'm creating a server that is listing TCP/IP sockets and create a separate thread for every connection the problem is I can't utilize all CPU cores because of Python GIL. In my case it is a real problem, I tested. So, I should create a pool of processes to handle connections and pass an opened connection to a process that I can send information to a client during process execution. So, I reduce socket: h = reduce_handle(self.request.fileno()) and pass 'h' to a process. Inside process I restore it: fd = rebuild_handle(h); client_socket = socket.fromfd(fd, socket.AF_INET, socket.SOCK_STREAM). I liked how it works. It is stable in production under Python 2.7.x and I don't know why it wasn't documented. P.S. Some links: Restore functionality of multiprocessing.reduction in Python 3.3: http://bugs.python.org/issue4892 Short doc of _multiprocessing module: http://doc.astro-wise.org/_multiprocessing.html ________________________________________ PyPy bug tracker <[email protected]> <https://bugs.pypy.org/issue1558> ________________________________________ _______________________________________________ pypy-issue mailing list [email protected] http://mail.python.org/mailman/listinfo/pypy-issue
