定时器UNIX crontab vs Quartz

  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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值