2017-03-05 22:08 GMT-08:00 Elliot Gorokhovsky <[email protected]>: > Another solution: check if there is more than one thread; if there is, then > disable optimization. Is sorting in multithreaded programs common enough to > warrant adding the complexity to deal with it? >
I think using a global is unsafe even without multithreading, because the compare function itself could end up doing list.sort() (it's calling arbitrary Python code after all). > > On Sun, Mar 5, 2017 at 10:52 PM Elliot Gorokhovsky > <[email protected]> wrote: >> >> On Sun, Mar 5, 2017 at 10:45 PM Elliot Gorokhovsky >> <[email protected]> wrote: >>> >>> >>> the problem is, how can we get a unique identifier for the thread in a >>> platform-independent way? Any ideas? >> >> >> Oh, I could probably just copy over code from threading.get_ident()... not >> sure if the key-value table is a good solution, though. > > > _______________________________________________ > Python-ideas mailing list > [email protected] > https://mail.python.org/mailman/listinfo/python-ideas > Code of Conduct: http://python.org/psf/codeofconduct/ _______________________________________________ Python-ideas mailing list [email protected] https://mail.python.org/mailman/listinfo/python-ideas Code of Conduct: http://python.org/psf/codeofconduct/
