Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #77208 > unrolled thread

Re: Thread terminate

Started bySkip Montanaro <skip@pobox.com>
First post2014-08-28 08:51 -0500
Last post2014-08-28 08:51 -0500
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Thread terminate Skip Montanaro <skip@pobox.com> - 2014-08-28 08:51 -0500

#77208 — Re: Thread terminate

FromSkip Montanaro <skip@pobox.com>
Date2014-08-28 08:51 -0500
SubjectRe: Thread terminate
Message-ID<mailman.13559.1409233872.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On Wed, Aug 27, 2014 at 1:55 PM, Ervin Hegedüs <airween@gmail.com> wrote:

> what's the correct way to terminate a thread by itself?


If this is something you need to do as a regular course of business, I'd
share a Queue between the main thread and the target thread. When you want
it to exit, shoot it a command to do so over the queue. If it's a worker
thread of some sort, set it as a daemon thread. When your main thread exits
and there are no other non-daemon threads alive, the program will exit.

Skip

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web