Issue 24296: Queue documentation note needed (original) (raw)
Issue24296
Created on 2015-05-27 12:22 by Sandy Chapman, last changed 2022-04-11 14:58 by admin. This issue is now closed.
Messages (3) | ||
---|---|---|
msg244156 - (view) | Author: Sandy Chapman (Sandy Chapman) | Date: 2015-05-27 12:22 |
The example at the bottom of the following page should have a warning added: https://docs.python.org/2/library/queue.html The warning should be such that the user is informed that the threads in the example are not cleaned up and will continue to run. Any future additions to the queue will then be processed immediately by those threads. | ||
msg244167 - (view) | Author: R. David Murray (r.david.murray) * ![]() |
Date: 2015-05-27 13:27 |
If you know anything about threads you can see that the threads are not explicitly shut down. As a standalone example it is "correct", in that they get shut down at interpreter shutdown. I'm not sure it is appropriate to include what is essentially a thread tutorial note in the queue docs. A crosslink to threading would certainly be a good idea; perhaps the introductory sentence could be tweaked to point people who don't already know threads in the correct direction for enlightenment. | ||
msg244171 - (view) | Author: Raymond Hettinger (rhettinger) * ![]() |
Date: 2015-05-27 15:02 |
It is normal for daemon threads to not be shut down. That is why they exist. The purpose of Queue.join() is to give other threads a way to know when daemons have finished doing their work (i.e. a print manager thread to indicate that it is done printing). If the worker threads were actually going to terminate, you wouldn't need Queue.join(), you would use a Thread.join(). |
History | |||
---|---|---|---|
Date | User | Action | Args |
2022-04-11 14:58:17 | admin | set | github: 68484 |
2016-04-26 08:22:04 | rhettinger | set | status: open -> closedresolution: not a bug |
2015-05-27 15:02:02 | rhettinger | set | messages: + |
2015-05-27 14:54:44 | rhettinger | set | assignee: docs@python -> rhettingernosy: + rhettinger |
2015-05-27 13:27:30 | r.david.murray | set | nosy: + r.david.murraymessages: + |
2015-05-27 12:22:01 | Sandy Chapman | create |