I'm working on upgrading a job scheduling system we use in-house that uses Quartz.net. Looking at the source of the latest version of Quartz, I noticed that it still uses its own thread pool implementation, as opposed the much-improved thread pool (or anything from System.Threading.Tasks) that started shipping with .NET 4.0.
I'd be curious to know if anyone has successfully implemented a job scheduling system that uses Quartz.net for its scheduling features and TPL for thread pooling. Is it relatively easy to swap out Quartz's thread pool for that of TPL? Is Quartz even still relevant in the world of Tasks? Alternatively, as sold as I am on the great improvements with the .NET 4.x thread pool (core awareness, local queues, improved locking, etc.), is Quartz's thread pool good enough for typical coarse-grained background jobs and not worth the effort of forcing TPL into the mix?
Thanks in advance for any insights on using (or not using) these two tools together.
The Task Parallel Library (TPL) is based on the concept of a task, which represents an asynchronous operation. In some ways, a task resembles a thread or ThreadPool work item but at a higher level of abstraction. The term task parallelism refers to one or more independent tasks running concurrently.
Quartz is distributed as a small dynamically linked library (. dll file) that contains all of the core Quartz functionality. The main interface (API) to this functionality is the Scheduler interface. It provides simple operations such as scheduling/unscheduling jobs, starting/stopping/pausing the scheduler.
Quartz is a richly featured, open source job scheduling library that can be integrated within virtually any Java application - from the smallest stand-alone application to the largest e-commerce system.
Quartz.NET is there to solve a bit different problem than TPL. Quartz.NET is intended for recurring job scheduling with rich set of capabilities for execution timing. TPL on the other hand is meant for highly performant parallel execution of computational workload.
So in essence you (usually) use Quartz.NET for precision scheduling and TPL for conccurent workloads that needs to be completed as quick as possible utilizing all computing resources (cores etc).
Having said this, I'd say the thread pool implementation that Quartz.NET uses is quite sufficient for the job. Also bear in mind that Quartz.NET is .NET 3.5 compliant and cannot use 4.0 only features.
Of course, you can also always combine the two in your solution.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With