A friend asked me how to learn multi-thread programming. I summarized it and listed some knowledge points:
1. Synchronized
2. runnable, thread, thread. Sleep, thread. Yield, thread. Join
3. Wait, policy, and policyall (pay attention to the acquisition and release of the lock)
4. mutex and semaphore
5. blockingqueue (very useful and must be mastered)
6. threadpool
7. executorservice
8. Future (very important and must be mastered)
9. readwritelock
10. Lock and condition. This is a multi-threaded library. The concept is similar to that of synchronized, object. Wait, and object. Category Y, but it is presented in a library and more flexible.
Deadlock, Dining Philosophers
12. TSL Assembly commands, compareandset (Java. UI. Concurrent. Atomic) in JDK 1.5, and interlock in Windows APIs
13. Application of working thread + Request queue
14. User thread, kernel thread, and user thread issues during fork (many UNIX and earlier Linux do not support kernel threads)
15. Windows Thread API, special API: waitformultiobject
related books:
"Java multi-thread design model" jiecheng Hao China Railway Publishing House (this book clearly shows the image and is very suitable for beginners to read)
Java concurrent programming-design principles and patterns (second edition) Doug Lea China Power Publishing House (not to mention, but also to read util. concurrent package source code or JDK 1.5 source code)
JAVA Thread Programming Paul Hyde people's post and telecommunications Publishing House (I think this book is also good)
POSIX multithreading Program Design David R. butenhof China Power Press
Windows core programming Jeffrey Richter Machinery Industry Press
Kay. robbins, Steve Robbins Mechanical Industry Press
modern operating system Andrew S. tanenbaum Machinery Industry Press
UNIX Network Programming (second edition) 2nd volume: inter-process communication W. richard Steven s Beijing kehai electronics Publishing House