Re: Thread Question
- From: Felipe Almeida Lessa <felipe.lessa@xxxxxxxxx>
- Date: Tue, 28 Feb 2006 17:42:11 -0300
Em Ter, 2006-02-28 às 20:38 +0000, Grant Edwards escreveu:
On 2006-02-28, D <duncanm255@xxxxxxxxxxx> wrote:
Thanks, Grant. I apologize for not being clear on what I
meant by using "classes". This is an example of what I was
referring to:
http://www.wellho.net/solutions/python-python-threads-a-first-example.html
Ah, I see. I had forgotten that people subclass Thread like
that. It's mostly just a matter of style. There aren't any
practical differences that I can think of.
Within a class you can maintain lots of internal states and make it
easily changable by other threads. Sure, you could archive this with
functions, but IMHO it's not pythonic. But for simple cases both would
suffice.
--
"Quem excele em empregar a força militar subjulga os exércitos dos
outros povos sem travar batalha, toma cidades fortificadas dos outros
povos sem as atacar e destrói os estados dos outros povos sem lutas
prolongadas. Deve lutar sob o Céu com o propósito primordial da
'preservação'. Desse modo suas armas não se embotarão, e os ganhos
poderão ser preservados. Essa é a estratégia para planejar ofensivas."
-- Sun Tzu, em "A arte da guerra"
.
- References:
- Thread Question
- From: D
- Re: Thread Question
- From: Grant Edwards
- Re: Thread Question
- From: D
- Re: Thread Question
- From: Grant Edwards
- Thread Question
- Prev by Date: Re: comple list slices
- Next by Date: Re: Thread Question
- Previous by thread: Re: Thread Question
- Next by thread: Re: Thread Question
- Index(es):
Relevant Pages
|