[issue34051] Update multiprocessing example

2018-07-07 Thread Windson Yang
Change by Windson Yang : -- stage: -> resolved status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue34051] Update multiprocessing example

2018-07-07 Thread Windson Yang
Windson Yang added the comment: Thank you, I think to use acquire() and release() may be better than with statement in this example. I will close this issue. -- ___ Python tracker __

[issue34051] Update multiprocessing example

2018-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: To be frank, I don't think that matters much. The user should understand what a lock is already, if they want to make use of multiprocessing fruitfully. The example showcases how to create a lock and how to pass it to child processes (by giving it as a fun

[issue34051] Update multiprocessing example

2018-07-07 Thread Windson Yang
Windson Yang added the comment: Hello, @Antoine Pitrou. Maybe there is another way to let the reader know "only one process prints to standard output at a time" instead of sleep() function? -- ___ Python tracker

[issue34051] Update multiprocessing example

2018-07-07 Thread Antoine Pitrou
Antoine Pitrou added the comment: The example feels a bit artificial indeed, but I don't think adding a sleep() call would make it realistic. Why would you protect sleep() with a lock? -- nosy: +pitrou ___ Python tracker

[issue34051] Update multiprocessing example

2018-07-05 Thread Windson Yang
Change by Windson Yang : -- nosy: +zach.ware ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

[issue34051] Update multiprocessing example

2018-07-05 Thread Raymond Hettinger
Change by Raymond Hettinger : -- assignee: docs@python -> davin nosy: +davin ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue34051] Update multiprocessing example

2018-07-05 Thread Windson Yang
New submission from Windson Yang : The docs at https://docs.python.org/3.8/library/multiprocessing.html#synchronization-between-processes give an example: from multiprocessing import Process, Lock def f(l, i): l.acquire() try: print('hello world', i) finally: l.re