This project has moved. For the latest updates, please go here.

Execution Queues

An execution queue can be seen as a type of threadpool - it basically controls how many jobs are executed in parallel.

Here are the differences :
  • ThreadPoolExecutionQueue
    • This is a wrapper around the .net framework threadpool. As such, it is hard limited by the .net framework machine config settings and a bit "fire and forget" - you throw a job in the pool and at some stage it will start.
    • The threadpool is shared by your appdomain, so there will a few less available threads than what the framework provides (the service itself uses a few).
    • The main limitations of this threadpool are that you cannot abort a job once started and you cannot specify a time limit on the execution. It also doesn't really matter what you set the threadcount to, as once the threadpool is full, all the other jobs will be queued on the threadpool.
  • ThreadExecutionQueue (Recommended)
    • This is a simple thread queue, where each job runs on it's own thread. You can theoretically up the ThreadCount to as high as you want, but remember that each thread has overhead.
    • This queue allows you to forcefully shut down a running job (as in when the service shuts down), but you still have no way of giving it an absolute timeout
  • TimedThreadExecutionQueue
    • This queue uses 2 threads per job. One to run the job, another to time it out (if absolutetimeout is set).
    • Only use this queue if you don't really have control of the downstream processing inside the job (i.e. you call some component which can theoretically just get stuck). Also specify an absolute timeout for it then.
    • Supports both absolute timeout and shutdown.

Last edited Mar 7, 2012 at 9:44 PM by dawidpotgieter, version 1


No comments yet.