implementation and effect of periodic execution of application(timer driven) in python -


i have 2 python application timer driven. these applications gets executed @ every fixed interval of time. code driven timers driven this:

while true:    do_something()    sleep(10) 

i have few questions:

  1. the application needs executed periodically. above stated way correct ?
  2. does needed daemonize these sort of applications or running in background of tools upstart ok ? how these 2 approaches different ?
  3. if have more 1 application on single machine (consider multi core cpu ) how these applications going get system resources during execution?
  4. what happen if cpu busy executing other tasks , meanwhile timer expires these applications, whetherthe job running on cpu preempted or depend on nature of job. if job non-preemptive , understanding goes job queued processing. if case , how make application run @ every definite time interval.

celery industry standard delayed , periodic tasks.

benefits using celery is:

  1. you can control , prevent tasks overlapping
  2. your tasks manage code not os
  3. and many more periodic tasks can view celery pereodic task