A timer enters the Spot queue; a worker uses another execution context

Only the Spot queue may touch state · a worker result returns to the Spot queue

A timer enters the Spot queue; a worker uses another execution context Only the Spot queue may touch state · a worker result returns to the Spot queue timer · ticks on its period · Architecture component timer ticks on its period arriving message · comes from outside · Architecture component arriving message comes from outside Spot queue · one at a time · one Spot Spot queue one at a time worker · another execution context · Architecture component worker another execution context tick enters Spot queue messages enter the same Spot queue hands off the long work result returns to Spot queue one Spot

State is not touched outside the Spot queue

  • • Because a tick enters the Spot queue, touching state inside a timer does not interleave with other processing. That is why no lock is needed.
  • • A worker uses another execution context, so it neither reads nor writes the Spot's state. Its result returns to the Spot queue and is applied there.