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


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

Re: problem on multi-threading

Started byChris Kaynor <ckaynor@zindagigames.com>
First post2014-07-25 09:08 -0700
Last post2014-07-25 09:08 -0700
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: problem on multi-threading Chris Kaynor <ckaynor@zindagigames.com> - 2014-07-25 09:08 -0700

#75235 — Re: problem on multi-threading

FromChris Kaynor <ckaynor@zindagigames.com>
Date2014-07-25 09:08 -0700
SubjectRe: problem on multi-threading
Message-ID<mailman.12338.1406356439.18130.python-list@python.org>

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

On Fri, Jul 25, 2014 at 12:45 AM, 水静流深 <1248283536@qq.com> wrote:

>
> never quit from the thread ,why?
>

I am going to guess that you can actually run code  in the interpreter
here. When printing from threads, the prompt will end up in the wrong place
as the prompt is printed in the main thread. Similarly, there is a (decent)
chance that the prints will be done out-of-order (multiple "<Thread..."
lines or URLs next to each other or on the same line). The odds that such
behavior will occur will increase as the work become more complex and more
threads are created. All of this can be resolved by manually using the
locking provided in the threading module.

[toc] | [standalone]


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


csiph-web