摘要:
func MulProduction() { concurrency := make(chan struct{}, 100) //控制最大协程数 wg := sync.WaitGroup{} defer close(concurrency) for id := 0; id < 100; id++ { 阅读全文
posted @ 2023-08-01 10:53
知道了呀~
阅读(34)
评论(0)
推荐(0)
摘要:
package main import ( "fmt" "sync" ) type Producer struct { ID int DataStream chan int WaitGroup *sync.WaitGroup } func (p *Producer) Produce(concurre 阅读全文
posted @ 2023-08-01 10:34
知道了呀~
阅读(45)
评论(0)
推荐(0)

浙公网安备 33010602011771号