go in the context

Introduced an article talking about the good
https://studygolang.com/articles/12566

Feel simple to understand, then you can take the thread pool analogy, say you have a task A, can be divided into a1, a2, a3 ..., with a thread pool to do when A as a parent thread will certainly be and the child thread to pass some content (variables, parameters, return value, etc.), then all of these elements need to be saved and can be transferred between the father and son, when the method is to make a thread pool before these variables are defined in a structure, and then hung on a parent-child thread and passed back and forth , clumsy.
go with more goroutine implemented, and implemented a context to complete some of the parameters passed between different environments and goroutine for the same task for developers

Guess you like

Origin blog.csdn.net/LiuYangQ_Q/article/details/91410983