08 2023 档案
摘要:背景: 1、对于有就绪状态的服务来说,进程起来了并不等同于服务就绪了,该服务能否提供服务强依赖于就绪状态2、服务的运行状态不是由服务进程决定的,而是由外部的状态开关去动态配置(start\handle\stop)3、如果服务从启动到进入就绪状态,需要较长的时间,在这个期间频繁的下发启动命令,就可能重
阅读全文
摘要:package main import ( "fmt" ) func printLetter(ch chan bool, letter string, nextCh chan bool, done chan bool) { for i := 0; i < 5; i++ { <-ch fmt.Prin
阅读全文
摘要: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
阅读全文