[java] Thread.start() x 2
I can''t seem to make a thread start a second time after it has been run(). I would like to recycle classes that run threads, so that I don''t need to use new since this seems to slow things down. Any ideas?
The thread''s dead baby. The thread''s dead. You can''t restart a dead thread. You can call the methods of a dead thread though.
I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!
I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
Well not really on this topic, but it sorta solves some of the problems with long initializing times of thread objects...
I found this page on how to construct a thread pool:
http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/perf.html#pool
It seems like the thread pool in this example can handle any type of objects as long as they implement the worker interface. I think it looks great, but what critique do you experts have to give on it? Are there any bad sides to using this?
I found this page on how to construct a thread pool:
http://developer.java.sun.com/developer/onlineTraining/Programming/JDCBook/perf.html#pool
It seems like the thread pool in this example can handle any type of objects as long as they implement the worker interface. I think it looks great, but what critique do you experts have to give on it? Are there any bad sides to using this?
Panic, this thread pooling is it good or bad? I need an answer quick (if possible! )
Give it a go and if it works for you then use it. I believe the VM uses object pooling so why not thread pooling.
I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!
I wanrned you! Didn''t I warn you?! That colored chalk was forged by Lucifer himself!
"... we should have such an empire for liberty as she has never surveyed since the creation ..."Thomas Jefferson
November 15, 2000 08:43 PM
pooling reusable objects is usually a good idea much better than removing them and recreating which is slow
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement