There's more...

If you need to use a data structure in your concurrent application, look in the Java API documentation to find the data structure that best fits your needs. Implement your own concurrent data structure that has some problems, which are as follows:

  • They have a complex internal structure
  • You have to take into account a lot of different situations
  • You have to design a lot of tests to guarantee that it works correctly

If you don't find a data structure that fits your needs completely, try to extend one of the existing concurrent data structures to implement one adequately to your problem.

Get Java 9 Concurrency Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.