-
Notifications
You must be signed in to change notification settings - Fork 232
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
c04/c04_08 #43
Comments
newTask和woker两个方法没看懂,为什么要这么写呢 |
newTask: 当前无任务执行或信道未满时,启动协程并执行,满了则阻塞直至不满 |
这里的defer能够生效吗 |
自己敲了一遍重新理解了一下,这里的worker函数中 defer func() { <-p.sem }() 语句是多余的 |
感觉这个例子我对channel理解多了点 |
struct {} :表示struct类型 struct {} {}:表示struct类型的值,该值也是空。 |
我感觉 defer func() { <-p.sem }() 语句不是多余的。 |
4.8 学习 Go 协程:如何实现一个协程池? — Go编程时光 1.0.0 documentation
https://golang.iswbm.com/c04/c04_08.html
The text was updated successfully, but these errors were encountered: