threads only called once?

Steve Holden sholden at holdenweb.com
Wed Aug 7 11:33:10 EDT 2002


"Gerson Kurz" <gerson.kurz at t-online.de> wrote in message
news:3d513035.5992578 at news.t-online.de...
> On Wed, 7 Aug 2002 10:03:29 -0400, "Steve Holden"
> <sholden at holdenweb.com> wrote:
>
> >Reading and following the documentation is just too much trouble. Why
> >doesn't Python do what I want?
>
> That is a good question, because most of the time Python *does* do
> what I want. Coincidence? Good Luck? Proof that free will doesn't
> exist? You be the judge.
>
Mostly it's due to Guido's ability at language design, I suspect.

[ ... ]
>
> After thinking more about that, I think the idea behind the Thread
> object is just this: to represent an OS Thread.
>
But in a way that's reasonably platform-independent. I'm nowhere near as
conversant as you with the various thread implementations on different
platforms.

> My reasoning was: The OS thread is just a function that has a separate
> "thread of execution". (This is the case in Win32, in OS/2, in Posix).
> Wrapping it in a class means, you want to provide "a baseclass" for
> *tasks*. The "Thread" class just provides a standard way of defining
> tasks (like: download data to a physical device, or handle incoming
> V24 messages, or handle incoming socket connections) that, as a
> side-feature, are run in their own thread.
>
Since the docs sepecifically suggest you only override __init_() and run(),
I'd have to agree with that. I have much less insight into the actual
mechanisms at library- or system-call-level, never having programmed threads
in a lower-level language.

> So, its really not a matter of not reading the documentation - I did
> read it, but did not activate my language-lawyer-mode (I believe the
> psychological buzzword is "anal-retentive") and thus failed to
> recognize the grave implications of "at most once". I apologize.
>

Well, you apparently know a great deal more about threading than I do. I'm
sure we could arrange to fix the documentation if you can contribute a patch
that makes the threads reusable. No apologies necessary -- I was actually
aiming more at the people who've read the documentation and still want
Python to be other than it is in fundamental ways. I suppose I should have
realized that irony would be misconstrued.

The development process seems to handle quite a lot of reasonable input. Not
all input is as reasonable as yours :-)

regards
-----------------------------------------------------------------------
Steve Holden                                 http://www.holdenweb.com/
Python Web Programming                http://pydish.holdenweb.com/pwp/
-----------------------------------------------------------------------








More information about the Python-list mailing list