码迷,mamicode.com
首页 > 其他好文 > 详细

定时器UNIX crontab vs Quartz

时间:2014-07-19 11:11:44      阅读:373      评论:0      收藏:0      [点我收藏+]

标签:定时器   quartz   unix   

  1. Using cron seems to add another entry point into your application, while Quartz would integrate into it. So you would be forced to deal with some inter-process communication if you wanted to pass some information to/from the process invoked from cron. In Quartz you simply (hehe) run multiple threads. cron是进程级别,Quartz是线程级别;如果任务之间有依赖、通信关系,那么cron将是一个大难题,而Quartz只需考虑线程之间如何调度的问题
  2. cron is platform dependent, Quartz is not. cron是依赖于unix平台的,而Quartz使跨平台的
  3. Quartz may allow you to reliably make sure a task is run at the given time or some time after if the server was down for some time. Pure cron wouldn‘t do it for you (unless you handle it manually).Quartz会保证即使服务重启,任务仍然会在指定的时间重新执行,而cron不会
  4. Quartz has a more flexible language of expressing occurences (when the tasks should be fired).Quarz支持更丰富的执行命令
  5. Consider the memory footprint. If your single tasks share nothing or little, then it might be better to run them from the operating system as a separate process. If they share a lot of information, it‘s better to have them as threads within one process.Quartz占用更少的内存,单进程内执行多任务,而 cron 每个任务都是一个单独的进程
  6. Not quite sure how you could handle the clustering in the cron approach. Quartz might be used with Terracotta following the scaling out pattern (I haven‘t tried it, but I believe it‘s doable).
  7. 补充,Quartz支持秒级别的任务,而 cron支持分钟级别的;Quratz有可视化的任务管理界面,监控、运维更方面,健壮性更强
  8. Quartz支持集群

原文:http://stackoverflow.com/questions/1029383/time-triggered-job-cron-or-quartz
参考:http://www.coderanch.com/t/63580/open-source/cron-Quartz

定时器UNIX crontab vs Quartz

标签:定时器   quartz   unix   

原文地址:http://blog.csdn.net/moon_yang_bj/article/details/37956757

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!