why the following python program does not face any concurrency problems without synchronize mechanism?

TheSaint nobody at nowhere.net.no
Sun Jul 10 16:50:11 CEST 2011


smith jack wrote:

>  have run this program for many times,and the result is always 5050
You might not need to make it in a multiprocess environment

Try it in the python (3) shell

>>> tot= 0
>>> for k in range(1,100):
...   tot += k
...   print(tot)
... 

And watch the risults.

-- 
goto /dev/null



More information about the Python-list mailing list