When I recorded the consumption of cycles, I found a very strange problem.
Motoko is a reactor model, should there be no concurrency problems? Or maybe it appears?
But when I clicked it multiple times quickly, the result was the same as the picture.
There are fewer cycles before the execution of the loop than after the execution of the loop
This is expected. You lose atomicity after await. So you cannot assume the global state is the same when the async calls reply back. See Joachim’s blog post about inter-canister calls.
Atomicity is only guaranteed between awaits – otherwise an await could block your canister indefinitely. See this section of the manual (especially the warning box).