Quartz 触发新线程?
石英调度程序是否为每个触发器创建一个新线程,或者只创建一个负责所有线程的线程?
Does a quartz scheduler create a new thread for each of the triggers or only a single thread which takes care of all the threads ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Quartz 使用可配置的线程池来执行计划任务。因此线程应该在作业执行之间回收。可以按照此处所述配置有多少个并行线程:
http://www.quartz-scheduler.org/documentation/quartz -2.x/configuration/ConfigThreadPool
由于您可以自己实现 ThreadPool 接口,但是您可以偏离并生成一个根本不进行池化的“ThreadPool”。 (此处描述了要实现的接口:http://www. docjar.com/docs/api/org/quartz/spi/ThreadPool.html)
Quartz uses a configurable thread pool to execute the scheduled tasks. So threads should be recycled between the job executions. How many threads there are in parallel can be configured as is described here:
http://www.quartz-scheduler.org/documentation/quartz-2.x/configuration/ConfigThreadPool
As you can give implementations to the ThreadPool interface yourself, you can, however, deviate and generate a "ThreadPool" that does no pooling at all. (The Interface to implement is described here: http://www.docjar.com/docs/api/org/quartz/spi/ThreadPool.html)