diff --git a/README.md b/README.md index f7a93fe..3c69ad8 100644 --- a/README.md +++ b/README.md @@ -171,15 +171,23 @@ p.Submit(func(){}) ``` ## Tune pool capacity -You can tune the capacity of `ants` pool at any time with `ReSize(int)`: +You can tune the capacity of `ants` pool at any time with `Tune(int)`: ``` go -pool.ReSize(1000) // Tune its capacity to 1000 -pool.ReSize(100000) // Tune its capacity to 100000 +pool.Tune(1000) // Tune its capacity to 1000 +pool.Tune(100000) // Tune its capacity to 100000 ``` Don't worry about the synchronous problems in this case, the function here is thread-safe (or should be called goroutine-safe). +## Release Pool + +```go +pool.Release() +``` + + + ## About sequence All the tasks submitted to `ants` pool will not be guaranteed to be addressed in order, because those tasks scatter among a series of concurrent workers, thus those tasks are executed concurrently. diff --git a/README_ZH.md b/README_ZH.md index 18263a7..28d2d0e 100644 --- a/README_ZH.md +++ b/README_ZH.md @@ -171,15 +171,21 @@ p.Submit(func(){}) ``` ## 动态调整协程池容量 -需要动态调整协程池容量可以通过调用`ReSize(int)`: +需要动态调整协程池容量可以通过调用`Tune(int)`: ``` go -pool.ReSize(1000) // Tune its capacity to 1000 -pool.ReSize(100000) // Tune its capacity to 100000 +pool.Tune(1000) // Tune its capacity to 1000 +pool.Tune(100000) // Tune its capacity to 100000 ``` 该方法是线程安全的。 +## 销毁协程池 + +```go +pool.Release() +``` + ## Benchmarks 系统参数: