Commit Graph

143 Commits

Author SHA1 Message Date
Andy Pan 99121e2404 chore: update some comments
Fixes #346
2024-12-11 21:10:03 +08:00
Andy Pan b40e489286
bug: alleviate the data race between Release() and Reboot() (#333) 2024-06-18 03:05:09 +08:00
Andy Pan 95dad45c7d
bug: alleviate the data race between Release() and Reboot() (#330) 2024-06-18 02:00:36 +08:00
Andy Pan 15e896153d
opt: make ReleaseTimeout() more efficient in waiting workers to exit (#329) 2024-06-18 01:06:48 +08:00
Andy Pan 3ffd3daa37
opt: calculate the interval for ReleaseTimeout() based on a default count (#327)
This PR reverts #325 to some extent.
2024-06-17 20:13:15 +08:00
Andy Pan 0d650f5c1e
opt: increase the interval of waiting in ReleaseTimeout() (#325) 2024-06-17 18:21:01 +08:00
Andy Pan fb82167503
opt: fall back to LeastTasks when RoundRobin can't find a worker (#306)
Besides, update a few comments and add new benchmarks for multi-pool
2023-11-21 13:22:02 +08:00
Andy Pan 19bd1ea02b
feat: add MultiPool and MultiPoolWithFunc (#305) 2023-11-21 11:53:46 +08:00
Andy Pan 2ce8d85f28
bug: return the error from Pool.Submit/PoolWithFunc.Invoke accordingly (#297) 2023-09-18 22:40:46 +08:00
Andy Pan 45bc4f51ba
chore: clean up some comments and CI yaml (#296) 2023-09-18 22:37:02 +08:00
POABOB aee9c2e2da
refactor: refine the code in `retrieveWorker` to make it more readable (#295) 2023-09-17 22:06:25 +08:00
E_L 2806c4af7c
opt: fix the potential goroutine leak after calling `Release()` (#287)
Co-authored-by: EL <evnldn9321@gmail.com>
2023-07-06 14:51:22 +08:00
Andy Pan 7be597c9e8 chore: code cleanup 2023-06-09 00:14:11 +08:00
Andy Pan b32591f8bd opt: awake blocking goroutines more precisely in purgeStaleWorkers
Fixes #272
2023-04-15 23:47:55 +08:00
Andy Pan 73defa0289 chore: rename the internal method in workerQueue 2023-04-04 13:01:14 +08:00
Andy Pan 4b495fd500 chore: code cleanup 2023-03-23 18:18:52 +08:00
Andy Pan e425c7b917 chore: rename the field 'recycleTime' of worker to 'lastUsed' 2023-03-23 15:18:56 +08:00
Andy Pan 0313effc53 opt: refactor the worker queue for reusability and readability of code 2023-03-23 12:28:47 +08:00
Andy Pan 711cad9624 chore: reorganize the structure of internal packages 2023-02-19 22:46:33 +08:00
Andy Pan 88d2454bbb fix: resolve the build failures 2022-12-20 22:29:21 +08:00
Andy Pan b6eaea118b opt: refine some code 2022-12-20 22:09:35 +08:00
Andy Pan 858f91f48b chore: code cleanup 2022-12-20 21:55:28 +08:00
Gleb Radchenko 23c4f48d0d fix: exit ticktock goroutine when pool is closed 2022-12-20 21:15:34 +08:00
Andy Pan 3fbd9567c9 opt: leverage binary-search algorithm to speed up PoolWithFunc.purgeStaleWorkers() 2022-12-11 19:49:58 +08:00
Andy Pan 846d76a437 opt: cache current time for workders and update it periodically 2022-12-11 19:49:58 +08:00
Andy Pan b604f7dc64 opt: fix the timeout error of ReleaseTimeout() with DisablePurge=true and improve tests 2022-10-11 22:52:13 +08:00
zhenshan.cao 8b106abaf3
Add option to turn off automatically purge (#253)
Fixes #252 

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
2022-10-11 21:16:04 +08:00
Andy Pan 9310acdff2 feat: implement pool.Waiting() API
Fixes #157
2022-05-07 22:43:25 +08:00
Andy Pan 15f3cdfb7b opt: refine ReleaseTimeout() 2022-05-06 20:27:08 +08:00
Andy Pan 96d074234a Add a new method -- ReleaseTimeout() for waiting all workers to exit
Fixes #212
2022-03-08 16:28:12 +08:00
codingfanlt fbd17036db
Awake the blocking callers when Tune(size int) is invoked to expand the pool (#210)
Fixes #205
2022-02-14 21:51:40 +08:00
Andy Pan 8d03fcf77f Fix the bug that blocks forever when call Release() before all tasks are done
Fixes #202
2022-02-08 13:53:21 +08:00
Andy Pan fdb318c1d7 Remove the unused error type and update some comments 2021-11-24 00:42:50 +08:00
Andy Pan 91b12588db Add comments about calling Submit()/Invoke() from Submit()/Invoke()
Fixes #197
2021-11-23 23:57:03 +08:00
Zhening Li f62e8ab1e0
style: fixed some typos in the comments (#184)
* style: fixed some typos in the comments

* style: add space between en and zh words

Co-authored-by: Zhening <18501262663@163.com>
2021-09-13 11:57:25 +08:00
Andy Pan 8ab8c9f899 Improve some comments 2021-05-23 20:23:43 +08:00
Andy Pan a2ad870d2d Returns -1 from Free() by unlimited pool
Fixes #152
2021-04-27 08:18:51 +08:00
Andy Pan dbcb6a104f Fix an issue that blocks all waiting callers when all workers panic
Fixes #146 #147
2021-03-28 22:37:56 +08:00
Andy Pan e01348e424 Fix a bug from the previous commit
Updates #141
2021-03-19 01:21:14 +08:00
Andy Pan 36c4272286 Fix a bug that blocks callers infinitely
Fixes #141
2021-03-18 21:42:54 +08:00
Z 94a7a7f1cb
fix: Memory leak (#114)
Fixes #113
2020-10-15 11:35:55 +08:00
Andy Pan 001c8b5e1b Update READMEs and comments 2020-08-12 20:49:20 +08:00
Andy Pan ad86bfa6d2 Improve the unlimited pool
Updates #90
2020-05-27 22:26:39 +08:00
Andy Pan 1c534853c8 Support unlimited pool
Fixes #90
2020-05-08 23:24:26 +08:00
Andy Pan d55cc24a22 Fix code issues 2020-04-08 13:16:14 +08:00
Andy Pan e507ae340f Support customized logger 2020-03-13 00:02:19 +08:00
Andy Pan d32d668565 Add a feature of rebooting a released pool 2020-01-16 23:45:15 +08:00
Andy Pan b7fb5f33c9 Remove the useless code line 2020-01-16 11:52:49 +08:00
Andy Pan 3bfc4f2ebd sync.Pool opt 2019-10-24 22:32:12 +08:00
Andy Pan 52b301019a Fix typos and add comments 2019-10-15 14:50:38 +08:00