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


Groups > comp.lang.python > #75235

Re: problem on multi-threading

References <tencent_1CC4554F04C01A7F6AB8300C@qq.com>
From Chris Kaynor <ckaynor@zindagigames.com>
Date 2014-07-25 09:08 -0700
Subject Re: problem on multi-threading
Newsgroups comp.lang.python
Message-ID <mailman.12338.1406356439.18130.python-list@python.org> (permalink)

Show all headers | View raw


[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.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: problem on multi-threading Chris Kaynor <ckaynor@zindagigames.com> - 2014-07-25 09:08 -0700

csiph-web