摘要:
func MulProduction() { concurrency := make(chan struct{}, 100) //控制最大协程数 wg := sync.WaitGroup{} defer close(concurrency) for id := 0; id < 100; id++ { 阅读全文
摘要:
package main import ( "fmt" "sync" ) type Producer struct { ID int DataStream chan int WaitGroup *sync.WaitGroup } func (p *Producer) Produce(concurre 阅读全文