Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

线程池中你不容错过的细节 建议 #168

Open
xiaoqingwanga opened this issue Aug 9, 2019 · 1 comment
Open

线程池中你不容错过的细节 建议 #168

xiaoqingwanga opened this issue Aug 9, 2019 · 1 comment

Comments

@xiaoqingwanga
Copy link

'为什是 run() 而不是 start()'
Runnable 没有 start() 方法。Runnable 本身代表的是一个任务,Thread 代表线程,Thread 才可以 start()。

@HemingPang
Copy link

'为什是 run() 而不是 start()'
Runnable 没有 start() 方法。Runnable 本身代表的是一个任务,Thread 代表线程,Thread 才可以 start()。

我也正想提这个问题:Runnable没有start方法。
另外,我觉得引出这个异常的同学代码没写好:针对业务线程池,consumer也是生产者,所以在consumer抛出异常后,必须从“队列”中获取product推送的消息,然后推送给内部workQueue。这样确保异常后,worker被干掉创建新的worker后,可以从内部workQueue中获取任务

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants