mirror of
https://github.com/duanhf2012/origin.git
synced 2026-02-04 06:54:45 +08:00
补充并发函数调用说明
This commit is contained in:
@@ -761,7 +761,8 @@ func (slf *TestService7) GoTest(){
|
|||||||
//以下通过cpu数量来定开启协程并发数量,建议:(1)cpu密集型计算使用1.0 (2)i/o密集型使用2.0或者更高
|
//以下通过cpu数量来定开启协程并发数量,建议:(1)cpu密集型计算使用1.0 (2)i/o密集型使用2.0或者更高
|
||||||
slf.OpenConcurrentByNumCPU(1.0)
|
slf.OpenConcurrentByNumCPU(1.0)
|
||||||
|
|
||||||
//以下通过函数打开并发协程数,以下协程最小1个,最大10个,任务管道的cap数量
|
//以下通过函数打开并发协程数,以下协程数最小5,最大10,任务管道的cap数量1000000
|
||||||
|
//origin会根据任务的数量在最小与最大协程数间动态伸缩
|
||||||
//slf.OpenConcurrent(5, 10, 1000000)
|
//slf.OpenConcurrent(5, 10, 1000000)
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user