(Transfer) Concurrency issues about quartz

1. Quartz is multi-threaded by default. If the object executing the task is not a singleton, each thread will generate a task object. The simultaneous execution of these task objects may cause concurrency problems.

2. The quartz.properties configuration file can be built by yourself. After it is built, scheduler = new StdSchedulerFactory(QUARTZ_CONFIG_PATH).getScheduler(); can generate a Scheduler configured according to your own configuration file

3. The meaning of the concurrent field means that if the task of a thread is not completed, concurrent=true means to open a new thread, concurrent=flase means to wait for the current thread to finish executing, it has nothing to do with single thread or multi thread

4. By the way, the problem of class locks and object locks, adding class locks, that is, static locks, is a class and a lock. When all objects generated by this class are accessed by multiple threads, only one thread can access the synchronized code at the same time. Block, and object lock is, one object one lock, multi-threading at the same time only one thread accesses the object plus synchronized code block, has nothing to do with other objects, other objects can also be accessed by threads at the same time

 

 

 

REFS:http://blog.csdn.net/flyflyflyflyflyfly/article/details/41870489

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326689777&siteId=291194637