Testing concurrency applications

Testing concurrency applications is a hard task. The threads of your application run in your computer without any guarantee of their execution order (except the synchronization mechanisms that you have included) so it's very difficult (impossible most of the time) to test all the circumstances that can occur. You can have errors impossible to reproduce because it only happens under rare or unique circumstances or errors that happen in one machine but not in others due to the number of cores within the CPU. To detect and reproduce this situation, you can use different tools:

  • Debug: You can use the debugger to debug the application. This process will be very tedious if you have only a few threads in the application ...

Get Mastering Concurrency Programming with Java 8 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.