correct some mistakes in English grammar

This commit is contained in:
Andy Pan 2018-12-06 00:37:12 +08:00
parent 974dc229df
commit 9b3fe4b603
3 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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()

View File

@ -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))