3
  1. Does onRunTask run on a different thread? This is not clearly explained in the documentation here https://developers.google.com/android/reference/com/google/android/gms/gcm/GcmTaskService. Or Is there other documentation I should look at?

  2. The documentation says:

Per service, two tasks with the same tag will never execute concurrently. Should a newly-scheduled task arrive while an existing task is still running, the new task will be dropped. In addition, different tasks may be scheduled concurrently, each invoked in a separate thread, if their schedules overlap. It is up to you to ensure thread safety when scheduling multiple tasks.

I'm confused about this part:

In addition, different tasks may be scheduled concurrently, each invoked in a separate thread, if their schedules overlap.

Does this still refer to a task with same tag, or is it referring to two tasks with different tags?

I was thinking it's referring to two tasks with different tags, because it says Per service, two tasks with the same tag will never execute concurrently.

In other words, my understanding is there will never be two tasks with same tag executing concurrently, but two tasks with different tags can be executed concurrently. Is this correct?

Don Box
  • 3,166
  • 3
  • 26
  • 55

0 Answers0