Quartz Thread Handling

Source: Internet
Author: User

Website

http://www.quartz-scheduler.net/

The relevant Log description

Http://netcommon.sourceforge.net/docs/2.1.0/reference/html/index.html

Blog Park friends >> lazy Fat bunny (he writes a lot of relevant articles, worth reading)

Http://www.cnblogs.com/lzrabbit/archive/2012/04/15/2448326.html

A lot of people ask quartz boot, shut down the service can not be closed in time, you must kill the process to be able to resolve the method when calling the shutdown method passed the parameter false, that is, do not wait for the end of the task to close immediately

Scheduler. Shutdown (FALSE);

>>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>> >>>>>>>

Quartz.net 2.0 There is a place where special attention is needed; The factoryadapter in App. config is no longer log4net replaced by log4net1211;

<logging>      <factoryadapter type="Common.Logging.Log4Net.Log4NetLoggerFactoryAdapter, Common.Logging.Log4Net1211">        <arg key="configtype" value=  "INLINE"/>      </factoryAdapter>    </logging>

Quartz timed tasks are performed concurrently by default, and do not wait for the last task to complete, as long as the interval is over, and if the timing is too long, it will take up resources and cause other tasks to become clogged.

There is a property that can change the default

    // the properties of the serial execution. [Quartz.disallowconcurrentexecution]
public class IJob:Quartz.IJob
{
public void Execute (Quartz.ijobexecutioncontext context)
{
}
}

@DisallowConcurrentExecution

This tag is used on the class that implements the job, which means that concurrent execution is not allowed, as I have previously understood, that the dispatch framework is not allowed to invoke the job class at the same time, and that it is not, but that the job (task) execution time [for example, 10 seconds] is greater than the time interval of the task [ Interval (5 seconds)], by default, the scheduling framework enables new threads to perform tasks in order to allow the task to execute at our scheduled intervals. Otherwise, it will wait for the task to complete and then execute again! (This will result in the execution of the task not being performed at our predefined intervals)

The time interval is set at 3 seconds, but the job execution time is 5 seconds, the program will wait for the task to execute after the completion of the @disallowconcurrentexecution, or the new thread execution will be enabled in 3 seconds.

Quartz Thread Handling

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.