Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

线程性能优化 #219

Closed
hanahmily opened this issue Jan 20, 2017 · 0 comments
Closed

线程性能优化 #219

hanahmily opened this issue Jan 20, 2017 · 0 comments

Comments

@hanahmily
Copy link
Contributor

优化线程池易用性与线程使用率

建议的新功能行为

  • 原有线程池对于每个操作都使用一个新的线程,并没有使用队列缓存操作。虽然提供了最大线程数参数,但在并行任务较多时,并不是增加线程数就会提供系统性能的。目前修改为线程数固定为当前操作系统的核数,采用无尽队列缓存无法及时处理的操作。

  • 在同时执行多句时,生成任务的主线程处于等待状态。这就造成了线程使用的浪费,目前改造为主线程去处理任务的中的第一个任务,余下的任务交由线程池去执行。提供整体系统的线程利用率。

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

1 participant