##// END OF EJS Templates
worker: explain why pickle reading stream has to be unbuffered
Manuel Jacob -
r50125:5d28246b default
parent child Browse files
Show More
@@ -280,6 +280,10 b' def _posixworker(ui, func, staticargs, a'
280 selector = selectors.DefaultSelector()
280 selector = selectors.DefaultSelector()
281 for rfd, wfd in pipes:
281 for rfd, wfd in pipes:
282 os.close(wfd)
282 os.close(wfd)
283 # The stream has to be unbuffered. Otherwise, if all data is read from
284 # the raw file into the buffer, the selector thinks that the FD is not
285 # ready to read while pickle.load() could read from the buffer. This
286 # would delay the processing of readable items.
283 selector.register(os.fdopen(rfd, 'rb', 0), selectors.EVENT_READ)
287 selector.register(os.fdopen(rfd, 'rb', 0), selectors.EVENT_READ)
284
288
285 def cleanup():
289 def cleanup():
General Comments 0
You need to be logged in to leave comments. Login now