-
-
Notifications
You must be signed in to change notification settings - Fork 10.9k
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
疑问:客户端任务执行的触发没有用线程池 #3546
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
版本
所有版本
问题
在客户端触发定时任务的动作里,见 JobThread 类;
采用了创建线程为载体,实现任务超时的回调函数;
疑问
因为需要考虑任务上下文 XxlJobContext ,父线程和子线程需要共享一个
ThreadLocal
,所以使用线程+InheritableThreadLocal
的组合(上述代码)可以理解;不过目前存有大量任务,都设有超时时间,并且存在会同时频繁执行的情况;
这样一来以上代码对原本平稳运行的系统会带来不小的隐患。
所以未来是否会考虑使用线程池+
TransmittableThreadLocal
的模式取代上述旧的执行逻辑 🤝The text was updated successfully, but these errors were encountered: