Multicore processing in JDK5
What was wrong with java.util.Thread
1.There are overheads with creating a new thread with the jvm
2.Object.wait(), and Object.notify() are insufficient for many programming tasks
3.The biggest disadvantage is how do you control the no of threads which you have to open. And how do you manage the resources consumed within the thread.?
A significant addition to jdk 5.0 has been java.util.concurrent library which would ease the development of multithreaded applications and servers
The two most important classes in this library are
java.util.concurrent.Executor
java.util.concurrent.Executors
java.util.concurrent package offers a number of advantages like
* Reduced programming effort: It is easier to use a standard class than re-inventing the wheel
* Increased performance: The implementations have been developed and tested by concurrency and performance experts, and therefore, they are faster and more scalable than typical implementations
* Increased reliability: The low-level concurrency primitives (such as synchronized, wait(), and notify()) are difficult to use correctly…and errors are not easy to detect or debug. On the other hand, the concurrency utilities are standardized and extensively tested against deadlock, starvation, or race conditions.
* Improved maintainability: Applications that are based on standardized packages are easier to maintain
* Increased productivity: Programmers are likely to already understand the standard library classes, so there is no need to learn new APIs








