I am very interested in testing concurrent code and avoid deadlock in multi-threaded environment.
I found your book has a chapter discussing on testing and wonder if it would includes integration with testing and mocking framework like JUnit, TestNG, Mockito, etc.
In addition, if your book has tips on avoiding deadlock.
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.
Javier, in your experience have you come across any sample projects/applications that really excel in helping the programmer develop understanding of the different aspects of multi-threaded programming? I developed a simple 'car park' application at university that had threads representing cars entering and leaving the car park, however this was essentially a collection of counters being incremented/decremented. If anyone has any interesting resources, I would be grateful for the share.
Javier Fernandez Gonzalez
Joined: Dec 10, 2012
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.