четверг, 5 июля 2018 г.

Java. How to start learning threads.

There are a lot of different ways to start learning Java threads.
Here is my approach to learn threads:
  1. Read the Java language tutorials on concurrency at https://docs.oracle.com/javase/tutorial/essential/concurrency/index.html.
  2. Learn basic constructs like synchronized and volatile.
  3. Learn about Dinning philosophers problem.
  4. Read Effective Java Programming Language guide 3rd edition section 11 Concurrency:
    1. Item 78. Synchronize access to shared mutable data
    2. Item 79. Avoid excessive synchronization
    3. Item 80. Prefer executors, tasks and streams to threads
    4. Item 81. Prefer concurrency utilities to wait and notify
    5. Item 82. Document thread safety
    6. Item 83. Use lazy initialization judiciously
    7. Item 84. Don't depend on the thread scheduler
  5. Try to read Java Concurrency in Practice.
I'm not sure I have covered everything, but it is a good ground to start with.
Regards.

Комментариев нет:

Отправить комментарий