Skip to content

Commit

Permalink
correct some mistakes in English grammar
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Dec 5, 2018
1 parent 974dc22 commit 9b3fe4b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion README_ZH.md
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
8 changes: 4 additions & 4 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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))
Expand Down

0 comments on commit 9b3fe4b

Please sign in to comment.