[issue39255] Windows and Unix run-time differences

Steven D'Aprano report at bugs.python.org
Wed Jan 8 04:57:10 EST 2020


Steven D'Aprano <steve+python at pearwood.info> added the comment:

I'm sorry, but perhaps I may have missed something here. The behaviour you show is what I would expect. In fact, I would expect that any two runs of your code will likely produce different output, even on the same machine using the same OS. I just ran it twice in Python 3.5 and got different results on the same machine:

    Run 1           Run 2
    x = 1           x = 1
    x = 2           x = 2
    x = 3           x = 3
    x = 4           x = 4
    y = 5           y = 5
    x = 5           x = 5
    x = 6           x = 6
    x = 7           x = 7
    x = 8           y = 8
    y = 9           x = 8
    x = 9           x = 9


You are running code concurrently in multiple processes. The order that the results are printed is unpredictable and will depend on many factors, including the OS.

Can you give any reasons why you consider this is to be a bug rather than normal behaviour?

I'm not going to close this as "Not a bug", since I'm not a multiprocessing expert and I may have misunderstood something, but it looks to me like normal behaviour when using threading or multiprocessing.

----------
nosy: +steven.daprano

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue39255>
_______________________________________


More information about the Python-bugs-list mailing list