Have to have a hand in the work, also need to look at the lost period of the big guy's learning route, he can have ascension.
This article link: http://342104628.iteye.com/blog/2422044
Key Concepts
Context Switches
1. Concept: The CPU passes the time slice algorithm, assigns the running time to the running thread, the switch between different threads need to save the state of the current thread and reply to the thread state information that will be executed, this process is the context switch.
2. How can I reduce or avoid context switching?
• Lock-free concurrent programming
· CAS algorithm
• Use minimal threads
• Co-process
Dead lock
1. Concept: Two or more threads hold each other's waiting lock
2. How do I avoid deadlocks?
• Prevent one thread from acquiring multiple locks at the same time
• Prevent a thread from consuming multiple resources within a lock, and try to ensure that each lock occupies only one resource
• Try to use a timed lock
• For database locks, lock and unlock must be in a database connection
Go concurrency mechanism
https://i6448038.github.io/2017/12/04/golang-concurrency-principle/