New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
threading.Thread objects are not reusable after join() #45967
Comments
After a call to join() method on a Threading.thread object,there is no Indeed, the __started flag is not reset in the theading.Thread join() Since it's perfectly legal to store a threading.Thread object in a |
From the documentation: I think this will not change: when a system thread terminates, you You should create and start different Threads each time. |
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. "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) 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! |
I agree with Amaury. This all works exactly as it should work, and will |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: