问题描述
我见过的本教程部分Quartz.NET文档,它应该是可以定义的最大线程数的Quartz调度将要使用。在我的特殊情况下,我想这个数字设置为1,但在API文档我不能找到一种方法来访问我的调度使用,并在其上设置任何属性的线程池实例。
I've seen in this tutorial section of the Quartz.NET documentation that it should be possible to define the maximum number of threads the Quartz scheduler is going to use. In my special case I want to set this number to 1. But in the API doc I couldn't find a way to access the threadpool instance my scheduler is using and to set any properties on it.
目前我的code是这样的:
Currently my code looks like this:
ISchedulerFactory schedFact = new StdSchedulerFactory();
IScheduler scheduler = schedFact.GetScheduler();
scheduler.Start();
// Setup jobs and triggers and then call scheduler.ScheduleJob...
是否有人知道我可以设置线程数池中?
Does somebody know how I can set the number of threads in the pool?
感谢您的帮助提前!
推荐答案
这取决于一点上,你正在使用的配置文件调度程序读取池。但是,如果你使用的是标准的 SimpleThreadPool.cs
则线程的数量可以quartz.config文件中进行配置,默认情况下,10个线程的创建方式:
It depends a bit on the pool you're using and the config file the scheduler is reading. But if you are using the standard SimpleThreadPool.cs
then the amount of threads can be configured inside the quartz.config file, by default 10 threads are created:
这篇关于如何设置线程的线程池Quartz.NET多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!