[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Paul Moore
Paul Moore added the comment: For me, I headed straight for "Sharing state between processes" and the "Shared memory" object. That's probably because I was reviewing someone else's code, rather than writing my own, but nevertheless when coding I do tend to dive straight for the section that

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Eryk Sun
Eryk Sun added the comment: > Agreed it's not a bug, but I will say it took me a while to work out > *why* it's not a bug (namely, that even though the OP is using shared > memory values, the code relies on fork semantics to share the two > Value objects that *reference* the shared memory).

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Paul Moore
Paul Moore added the comment: Agreed it's not a bug, but I will say it took me a while to work out *why* it's not a bug (namely, that even though the OP is using shared memory values, the code relies on fork semantics to share the two Value objects that *reference* the shared memory). It wo

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Steve Dower
Steve Dower added the comment: Agreed it's not a bug. The best we could do is display a warning that fork is not portable (won't work on macOS anymore either, IIRC) and you should at least verify that spawn behaves the same. -- ___ Python tracker

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Eryk Sun
Eryk Sun added the comment: > I am not going to close it as I am unsure if it is by design that > Windows and Unix python acts differently. For compatibility, a script should support the spawn start method. Spawning child processes is the only available start method in Windows, and, as of P

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Kallah
Kallah added the comment: The difference here is that on Windows y will never change, it will stay 1 forever while on Unix systems y will increment. Having done a bit more research it seems this is due to the way multiprocessing works on Windows vs Unix systems. In unix systems the new threa

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Steven D'Aprano
Steven D'Aprano 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 tw

[issue39255] Windows and Unix run-time differences

2020-01-08 Thread Kallah
New submission from Kallah : In the attached sync.py, running it on windows and Unix (Ubuntu and OSX tested) will grant different results. On windows it will output: x = 1 x = 2 x = 3 y = 1 x = 4 x = 5 x = 6 x = 7 y = 1 While on ubuntu it will output: x = 1 x = 2 x = 3 y = 4 x = 4 x = 5 x = 6 x