Prof Plum <dwyerf...@gmail.com> added the comment: @Antoine Pitrou
>Well... it's called *async* for a reason, so I'm not sure why the behaviour >would be partially synchronous. To a avoid race condition >I'm not sure how. In mp.Pool we don't want to keep references to input >objects longer than necessary. Like I said you could just add some sort of "safe" flag to the apply_async() call safe=True would mean the initialization of the worker is done synchronously safe=False would be the normal behavior. Even if you decide it's the user's responsibility to not delete the queue if the user's code is exiting a function that would basically amount to them calling sleep() for some guessed amount of time. With a safe flag they wouldn't have to guess the time or call sleep which is kinda ugly IMO. Also if someone see's that apply_async() has a safe flag they are more likely to look up what it does than they are to read the full docs to apply_async(). ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31092> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com