Javier Fernandez Gonzalez

author
+ Follow
since Dec 10, 2012
Merit badge: grant badges
Biography
Javier Fernández González is a software architect with over 10 years experience with Java technologies. He has worked as a teacher, researcher, programmer, analyst, and now as an architect in all types of projects related to Java, especially J2EE. As a teacher, he has taught over 1,000 hours of training in basic Java, J2EE, and Struts framework. As a researcher, he has worked in the field of information retrieval, developing applications for processing large amount of data in Java and has participated as a co-author on several journal articles and conference presentations. In recent years, he has worked on developing J2EE web applications for various clients from different sectors (public administration, insurance, healthcare, transportation, and so on). He currently works as a software architect at Capgemini developing and maintaining applications for an insurance company.
For More
Asturias (Spain)
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Javier Fernandez Gonzalez


Thank you all. It was a pleasure for me.

Best regards

Hi Suhaib. What do you mean with real time?. We have tried that the examples reflect real world situations so you can use it in your applications. Take into account that each recipe explains a concept using an example and they have between 4 and 10 pages, so the examples can't be very big.

If you need more info, please let me know.

Hello Paul

He have tried that the examples reflect real world situations. Take into account that each recipe explains a concept using an example and they have between 4 and 10 pages, so the examples can't be very big.

If you want to see a complete application that uses concurrency elements, you can take a look to a open source project

If you need more info, please let me know

Hello Leandro and thank you for your comments

The main features introduced by the Java 7 Concurrency API are

-The new Fork/Join framework
-The phaser class, that is a new synchronization mechanism to execute tasks that can be divided into phases
-Some data structures that can be used in concurrent applications.

All these elements are oriented to solve concrete problems. The fork/join framework is oriented to get a better performance in problems that can be solved using a divide and conquer approach. The phaser class is uses to synchronize concurrent tasks that are divided into phases when you need to synchronize the tasks between each phase. You can solve that problems with Java 6 concurrency elements, but probably your program will have worse throwput.

If you need more info, please let me know

Hi Stuie

The book has a lot of examples and each of them explain a functionality of the Java 7 Concurrency API. I think all of them are very clear and explain well the concept they want to explain. You can download the source code of the book as Eclipse projects so you can play with them.

If you want to see a bigger real application that uses concurrency classes, you can investigate the source code of an open source project that uses them.

If you need more info, please let me know.

Hello Rick

This book is strictly about Java Concurrency API. It doesn't include anything about Java 8 or other languages as Scala or Groovy. I want to test the concurrency features of those languages, but i haven't worked with them yet.

Hello Raymond

The book includes a chapter about testing concurrency code that includes:

-Monitoring concurrency related classes, as Lock, Phaser, Executor or the Fork/Join pool
-How to write effective log messages in a concurrent enviroment
-How to configure Eclipse and Netbeans to debug concurrent applications
-How to analyze concurrent code with FindBugs
-How to test concurrent code with the MultithreadedTC library

We have include the frameworks you mention, but it's an interesting theme to be included in future works.

The book includes an appendix, that it's not included in the physical book, but it can be downloaded from the Packt's website, that include some tips about how to design a concurrent application and how to avoid a deadlock situation. All the examples explained in the book show how to use the different elements of the Java Concurrency API avoiding deadlocks.

If you need more info, please let me know.
Hello Qunfeng

Java 7 doesn't introduce new features to make life easier to programmers. The most significant new feature it's the Fork/Join framework, but it's a kind of Executor and Executors where introduced in Java 5. I suppose that you know it. The new features of Java Concurrency API are oriented to concrete problems and they

I haven't worked with Scala yet, but it's on my list of pending tasks. I want to test the concurrency features of Scala, Groovy and Clojure.

If you need more info, please let me know.
Hi Rohan

The book include the high level synchronizers that you mention. Chapter 3, Thread Synchronization Utilities, includes recipes about Semaphores, CountDownLatch, CyclicBarrier and Exchanger classes. The Java 7 API includes a new synchronization utility, the Phaser class. This class is useful when you have to execute concurrent tasks divided into phases and you need to synchronize them between each phase.

If you need more info, please let me know.
Hello Zico and Mike

Testing a concurrent application is a complex task. As the order of execution of the tasks are not guarantee, you can't simulate all the possible options. As Mike said, if you make a block of code synchronized, you have the guarantee that only one thread will execute that portion of code. If you want to test that more than one thread are synchronized between them and they don't generate inconsistency results, you can take a look to the MultithreadedTC library. It includes an internal metronome to control the order of execution of tasks, so you can provoke a problematic situation to check if your code behaves as expected. The book includes a recipe in the chapter 8, Testing Concurrent Applications, that explains how to use that library.

If you need more info, please let me know.

Hello Suhaib

Yes, the book covers the most important features of the Java 7 Concurrency API. We gave more importance to the new features in the Java 7 version, but it include recipes that show how to use the basic features of the concurrency API. For example, the first chapter of the book include the following recipes

-Creating and running a thread
-Getting and setting thread information
-Interrupting a thread
-Controlling the interruption of a thread
-Sleeping and resuming a thread
-Waiting for the finalization of a thread
-Creating and running a daemon thread
-Processing uncontrolled exceptions in a thread
-Using local thread variables
-Grouping threads into a group
-Processing uncontrolled exceptions in a group of threads
-Creating threads through a factory

As you see, it includes basic thread operations.

If you need more info, please let me know.

Hello Román and thank you very much.

I talked with Packt about the translation of the book last week. All the people ask me about that. They are going to try to find an spanish editor to publish the spanish version of the book.

If you want, contact me in LinkedIn or give me your email address and i'll inform you if there are some news about this.
Hello Luke

Yes, the book includes a chapter (chapter 5) dedicated to the new Fork/Join framework. That chapter includes the following recipes that show how to use the most important features of that framework:

-Creating a Fork/Join pool
-Joining the results of the tasks
-Running tasks asynchronously
-Throwing exceptions in the tasks
-Canceling a task

The chapter 9, (Additional Information) also includes a recipe about the Fork/Join Framework:

-Processing uncontrolled exceptions in a ForkJoinPool class

The chapter 9 it's not included in the paper book, but you can download it from the Packt's website

If you need more info, please let me know.
Hi Herry

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.

If you need more info, please let me know.
Hello Bob

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.