Originally posted by Nigel Browne:
Would you please explain the difference between a thread pool and a thread group.
Originally posted by Pradeep Bhat:
When an application requires a thread it request from the pool and when it finishes using a thread it returns it to the pool. The thread returned to pool does not die and is kept alive.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Jim Bracks:
The suspend(), stop() and resume() methods are all deprecated because they have the potential to leave objects in inconsistent states. IMO they should be removed from the Thread class completely.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Nigel Browne:
Would you please explain the difference between a thread pool and a thread group.
Originally posted by Ko Ko Naing:
Will it ever be killed? Or is it floating in the pool of Threads till the application terminates? Pradeep, I've known about thread pool, but I've never known about the end of the threads lives... Thanks...![]()
Originally posted by Ko Ko Naing:
Are there any other deprecated methods that were removed from the later JDK versions? Because as far as I know, deprecated methods are still in the later JDK versions so that the applications that are still using the methods can still be working without the need to change the source codes...
Thanks for sharing your opinions...![]()
1. What motivated you to write the book ?
2. Is there something that is missing currently in Java Threads that you would like to be added.
3. Why hasn't Sun removed deprecated methods like stop from the Thread class ? It has been a long time since they were deprecated.
Originally posted by Pradeep Bhat:
I would also like to know your opinion about the new concurrent Collection classes.
Thanks.
Thread pool means a pool of threads. It is better to reuse threads rather than create them again and again. When system starts up it may create a pool of threads.
When an application requires a thread it request from the pool and when it finishes using a thread it returns it to the pool. The thread returned to pool does not die and is kept alive.
I am not sure how this pool is implemented, may be the authors could help us.
Originally posted by Henry Wong:
There are actually issues and conditions on when to use, and not use, a thread pool.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Ko Ko Naing:
Is it like we can configure whether to use or not use Thread pool? I was always thinking that Thread pool is available to the application since the beginning and we cannot avoid to use it...![]()
Thanks...![]()
Originally posted by Ko Ko Naing:
Henry,
Is it like we can configure whether to use or not use Thread pool? I was always thinking that Thread pool is available to the application since the beginning and we cannot avoid to use it...![]()
Thanks...![]()
JDK 1.5 added a thread pool... And for those with previous versions of Java, or want to know how to implement one, we actually implemented a thread pool in the book. Unfortunately, with the third edition, we had to cut many of the implementation discussions that was in the second edition.
Originally posted by Henry Wong:
There are actually issues and conditions on when to use, and not use, a thread pool. It is not just as simple as reusing threads. (which we do discuss)
Henry
Originally posted by Pradeep Bhat:
Thanks Henry.
Does the book talk about how to use threads when there are multiple processors or there is no difference between a single processor multiple processor environments as far Java threads are concerned?
Originally posted by Ali Pope:
Probably if you have used correctly the threads will be able to see a performance improvement on a multi-processor machine.
Co-author of SCMAD Exam Guide, Author of JMADPlus
SCJP1.2, CCNA, SCWCD1.4, SCBCD1.3, SCMAD1.0, SCJA1.0, SCJP6.0
Originally posted by Ali Pope:
It doesn't matter how many processors are on the JVM on which the machine is running. Probably if you have used correctly the threads will be able to see a performance improvement on a multi-processor machine
./pope
Originally posted by karthik Guru:
Machine1: 1800 MHZ Single CPU
Machine2: 450MHZ X 4 CPUs
Originally posted by Ko Ko Naing:
You mean some kinda mechanisms like pipelining should be used for performance improvement on a multi-processor machine, where we can fully make use of hardware advantage to fulfil the requirements of a problem...![]()
Just my 2 cents...![]()
Originally posted by Pradeep Bhat:
Thanks Henry.
Does the book talk about how to use threads when there are multiple processors or there is no difference between a single processor multiple processor environments as far Java threads are concerned?
Originally posted by Ali Pope:
What does it mean a J2EE application for a single use?
The calculus for the above cannot be done without testing/monitoring. I have said "probably" :-).
./pope
If there are no threads within out code (as discouraged by j2ee), then can the code take advantage of the fact that there are 4 CPUs?.
So the response times on a single CPU but 1800 MHZ has to be better than that on a 4 CPU box 450 MHZ?
I mean single user response time.
The government thinks you are too stupid to make your own lightbulb choices. But this tiny ad thinks you are smart:
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|