Victor Parmar
Victor Parmar

Reputation: 5789

Does the quartz scheduler run on its own thread?

I'd like to use quartz in a project of mine. I know that there is a scheduler and a threadpool for the jobs.

Upvotes: 1

Views: 3042

Answers (2)

AlexR
AlexR

Reputation: 115398

Yes, quartz uses at least n+1 threads where 1 is the scheduler thread that is running in an infinite loop sleeping before next task that should be triggered. N is the number of worker threads in the threadpool. You can configure this number using the property org.quartz.threadPool.threadCount.

Upvotes: 4

Gimby
Gimby

Reputation: 5282

You can see it work by running the stuff through for example Eclipse and then in the debug view you can see the active and sleeping threads of the application.

Quartz will create a configurable pool of threads. Each job will fire in its own thread (of course, otherwise they can't run concurrently). And no, its not a busy loop so the scheduler won't claim a CPU for itself.

Upvotes: 1

Related Questions