1
votes

Supposing I have two cron jobs in my app which run at the same time:

- description: purge old articles
  url: /purge
  schedule: every 12 hours

- description: parse comp apps
  url: /comp
  schedule: every 12 hours

Do they run simultaneously within the GAE runtime? Or are they done sequentially -- if so, then in what order? If they do run sequentially, would I have to use task queues in order to simulate simultaneous tasks (since, as far as I am aware, multithreading is not possible in app engine)?

1
By the way, multithreading is possible in App Engine: the same instance may process multiple requests at the same time. - Andrei Volgin
I have done asynchronous urlfetch requests; however, I was under the impression that you couldn't manually create extra threads - Hari Ganesan
You cannot manually create threads, but you can hit the same handler multiple times, and these requests will be executed in parallel, if your instance can handle it. In your use-case, however, you don't need threads. - Andrei Volgin

1 Answers

4
votes

Cron jobs run independently of each other. Therefore, there is no guarantee that they will run either sequentially or simultaneously.

If you want two tasks to be executed either sequentially or simultaneously, put them in the same cron job - there is no reason to create two cron jobs in this case.