Irit Katriel <iritkatr...@yahoo.com> added the comment:
I've now reproduced it on osX, with string length of 65515. It takes a different code path than the windows version, and I was able to see more. This seems to be the sequence of events that leads to the hang: import multiprocessing.reduction import struct import os string_length = 65515 obj = "a"*string_length obj = multiprocessing.reduction.ForkingPickler.dumps(obj) m = memoryview(obj) n = 65533 mm = m[0:n] _, writer = os.pipe() header = struct.pack("!i", n) os.write(writer, header) os.write(writer, mm) I think what's happening is that the os.pipe that the queue is writing to has filled up, and then write blocks until any of it has been consumed. This version of your script seems to confirm that: import multiprocessing import sys q = multiprocessing.SimpleQueue() string_length = eval(sys.argv[1]) print(string_length) long_string = "a"*(string_length//2) q.put(long_string) q.get() <---- comment this out and it hangs again q.put(long_string) print("Never reach this line :-(") ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue41550> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com