From 9b3fe4b6038c8a682d6a5b95c067aed985445c5f Mon Sep 17 00:00:00 2001 From: Andy Pan Date: Thu, 6 Dec 2018 00:37:12 +0800 Subject: [PATCH] correct some mistakes in English grammar --- README.md | 4 ++-- README_ZH.md | 2 +- examples/main.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index a5063cd..fcc558d 100644 --- a/README.md +++ b/README.md @@ -82,7 +82,7 @@ func main() { fmt.Printf("finish all tasks.\n") // Uses the pool with a function, - // sets 10 the size of goroutine pool and 1 second for expired duration + // sets 10 to the size of goroutine pool and 1 second for expired duration p, _ := ants.NewPoolWithFunc(10, func(i interface{}) { myFunc(i) wg.Done() @@ -215,7 +215,7 @@ In that benchmark-picture, the first and second benchmarks performed test with 1 ![](ants_bench_poolwithfunc.png) -### Throughput (situation for only submitting tasks and need not waiting for all the tasks to be completed) +### Throughput (it is suitable for scenarios where asynchronous tasks are submitted without concern for results) #### 100K tasks diff --git a/README_ZH.md b/README_ZH.md index bdf408d..f333297 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -81,7 +81,7 @@ func main() { fmt.Printf("finish all tasks.\n") // Uses the pool with a function, - // Sets 10 the size of goroutine pool and 1 second for expired duration + // sets 10 to the size of goroutine pool and 1 second for expired duration p, _ := ants.NewPoolWithFunc(10, func(i interface{}) { myFunc(i) wg.Done() diff --git a/examples/main.go b/examples/main.go index 23f39db..a45eb41 100644 --- a/examples/main.go +++ b/examples/main.go @@ -49,7 +49,7 @@ func main() { runTimes := 1000 - // use the common pool + // Uses the common pool var wg sync.WaitGroup for i := 0; i < runTimes; i++ { wg.Add(1) @@ -62,14 +62,14 @@ func main() { fmt.Printf("running goroutines: %d\n", ants.Running()) fmt.Printf("finish all tasks.\n") - // use the pool with a function - // set 10 the size of goroutine pool and 1 second for expired duration + // Uses the pool with a function, + // sets 10 to the size of goroutine pool and 1 second for expired duration p, _ := ants.NewPoolWithFunc(10, func(i interface{}) { myFunc(i) wg.Done() }) defer p.Release() - // submit tasks + // Submits tasks for i := 0; i < runTimes; i++ { wg.Add(1) p.Serve(int32(i))