Two ways to wait in one SpotWide Spot

Async keeps the turn; Yield gives execution to the next turn in the same Spot

Two ways to wait in one SpotWide Spot Async keeps the turn; Yield gives execution to the next turn in the same Spot turn A · request with Async · Async — keeps the gate turn A request with Async turn A waits · holds the gate · Async — keeps the gate turn A waits holds the gate turn B · waits in queue · Async — keeps the gate turn B waits in queue turn A · request with Yield · Yield — gives back the gate turn A request with Yield turn B · runs with the gate · Yield — gives back the gate turn B runs with the gate turn A resumes · new turn at tail · Yield — gives back the gate turn A resumes new turn at tail remote work · returns a result later · Architecture component remote work returns a result later submit request next turn waits wait for result reply → same turn give back gate tail after completion submit request reply → new turn Async — keeps the gate Yield — gives back the gate

Async

  • • await frees the thread but leaves the SpotWide gate held.
  • • So turn B cannot start until the reply arrives.

Yield

  • • turn A ends and gives back the gate, so turn B runs.
  • • The reply continuation re-enters after turn B as a new turn.