Here is my approach to learn threads:
- Read the Java language tutorials on concurrency at https://docs.oracle.com/javase/tutorial/essential/concurrency/index.html.
- Learn basic constructs like synchronized and volatile.
- Learn about Dinning philosophers problem.
- Read Effective Java Programming Language guide 3rd edition section 11 Concurrency:
- Item 78. Synchronize access to shared mutable data
- Item 79. Avoid excessive synchronization
- Item 80. Prefer executors, tasks and streams to threads
- Item 81. Prefer concurrency utilities to wait and notify
- Item 82. Document thread safety
- Item 83. Use lazy initialization judiciously
- Item 84. Don't depend on the thread scheduler
- Try to read Java Concurrency in Practice.
Regards.
Комментариев нет:
Отправить комментарий