aspose file tools*
The moose likes Threads and Synchronization and the fly likes Java 7 Concurrency Cookbook: Testing Concurrent Code & Avoid Deadlock Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Threads and Synchronization
Bookmark "Java 7 Concurrency Cookbook: Testing Concurrent Code & Avoid Deadlock" Watch "Java 7 Concurrency Cookbook: Testing Concurrent Code & Avoid Deadlock" New topic
Author

Java 7 Concurrency Cookbook: Testing Concurrent Code & Avoid Deadlock

Raymond Tong
Ranch Hand

Joined: Aug 15, 2010
Posts: 230
    
    2

Hi Javier,

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.

Thanks
Javier Fernandez Gonzalez
author
Greenhorn

Joined: Dec 10, 2012
Posts: 20
    
    5

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.

Author of Java 7 Concurrency Cookbook
Stuie Clarky
Ranch Hand

Joined: Nov 09, 2012
Posts: 73

Hi all,

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.

Cheers,

S


OCAJP 7
Javier Fernandez Gonzalez
author
Greenhorn

Joined: Dec 10, 2012
Posts: 20
    
    5

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.
Stuie Clarky
Ranch Hand

Joined: Nov 09, 2012
Posts: 73

Thanks for the information, I look forward to getting stuck into the examples

Cheers,

S
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java 7 Concurrency Cookbook: Testing Concurrent Code & Avoid Deadlock