I'm returning to Java after a long hiatus but have most recently been in the C# world. I realize that parallelism and thread concurrency are different, but regarding parallelism in C#, the challenge for the programmer was not learning the syntax. The REAL challenge is learning when it's (parallelism) effective (spotting when it's effective in code) and when it can actually hurt you speed-wise. Was wondering if this was an issue with thread synchronization and if you covered anything similar in the book.
I think the new features of Java 7 Concurrency API doesn't change the approach to concurrency practices. Basically, the new features introduced with this version are
-The new Fork/Join framework, that is oriented to problems that can be resolved using the divide and conquer technique
-The phaser synchronization method, that is oriented to the execution of tasks that can be divided into phases
-Some new data structures that can be used in concurrent applications
So, basically, they are specializations oriented to a concrete class of problems.
The book covers the most important aspects of the Java 7 Concurrency API, but we gave more importance to the new features.
In every concurrent application, independently of the programming language, the design phase is critical. The Java Concurrency API give you the tools to implement concurrent applications, but you have to use well. If you do a bad design of your concurrent application, you will get a bad throughput or bad results if you don't apply well the synchronization mechanisms.
The book includes a lot of examples that show how to use the java concurrency mechanisms in a correct way, so you won't have problems in your concurrent applications. The book also includes and appendix (it's not in the book, but you can download them from the Packt's website) that includes some tips about how to design concurrent applications.
If you need more info, please let me know.
Javier Fernandez Gonzalez
Joined: Dec 10, 2012
Java Concurrecy API uses all the cores available in the machine to execute the threads. I think the most interesting mechanism to you are the Executor Framework or the new Fork/Join Framework. The book includes a chapter about each one (Chapters 4 and 5). If you give me more information about the kind of problem you need to solve, i can give you more help.