首页 > 代码库 > 定时器UNIX crontab vs Quartz
定时器UNIX crontab vs Quartz
- Using
cron
seems to add another entry point into your application, whileQuartz
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 fromcron
. InQuartz
you simply (hehe) run multiple threads. cron是进程级别,Quartz是线程级别;如果任务之间有依赖、通信关系,那么cron将是一个大难题,而Quartz只需考虑线程之间如何调度的问题 cron
is platform dependent,Quartz
is not. cron是依赖于unix平台的,而Quartz使跨平台的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. Purecron
wouldn‘t do it for you (unless you handle it manually).Quartz会保证即使服务重启,任务仍然会在指定的时间重新执行,而cron不会Quartz
has a more flexible language of expressing occurences (when the tasks should be fired).Quarz支持更丰富的执行命令- 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 每个任务都是一个单独的进程
- 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). - 补充,Quartz支持秒级别的任务,而 cron支持分钟级别的;Quratz有可视化的任务管理界面,监控、运维更方面,健壮性更强
- 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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。