This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author dweeves
Recipients amaury.forgeotdarc, dweeves
Date 2007-12-14.14:31:24
SpamBayes Score 0.02838218
Marked as misclassified No
Message-id <BAY140-W6703293448CB7709475ECBC670@phx.gbl>
In-reply-to <1197637434.43.0.170929606938.issue1626@psf.upfronthosting.co.za>
Content
Hi Amaury,

to me,Thread objects are meant to be abstract representation of a processing that will occur in a separate execution unit at thread start time.
Indeed, that's what the following text (from the link you provided tries to explain)

"Once a thread object is created, its activity must be started by calling the thread’s start() method. This invokes the run() method in a separate thread of control."

So, the 'System Thread' is only created at start() call (which is a good implementation choice)
Moreover, the join() method (when completed) will wait for the System Thread to be disallocated.

However, the Thread object instance and the processing bound to it are still valid.

So in an object oriented point of view, (and syntactically too) , it should be valid to reuse the object (and so repeat the processing bound to it) as many times as necessary without the need to create a new instance as long as the Thread object state is not Alive.

What suprises me , is that the current implementation  of threading.Thread (apart from the __started flag behaviour) is compatible with that point of view and i see no limitations (apart that bug) preventing such a use of threads.

I think the threading API will provide better 'high-level' view if it didn't depend on low level considerations (as the dependency on the existence / reusability of the peer System Thread that will be used to effectively host the code execution)

Regards,

Sebastien

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/
Files
File name Uploaded
unnamed dweeves, 2007-12-14.14:31:23
History
Date User Action Args
2007-12-14 14:31:24dweevessetspambayes_score: 0.0283822 -> 0.02838218
recipients: + dweeves, amaury.forgeotdarc
2007-12-14 14:31:24dweeveslinkissue1626 messages
2007-12-14 14:31:24dweevescreate