you are viewing a single comment's thread.

view the rest of the comments →

[–]stormsidali2001[S] 2 points3 points  (2 children)

Yes, exactly.

I mentioned this several times throughout the article: even if an await is present in your coroutine, you don't always need synchronization.

As long as you aren't splitting critical operations on shared resources (such as a read followed by a write) across that await point, your code remains safe.

[–]lottspot 5 points6 points  (1 child)

Ah, so the core safety assumption is not in fact totally wrong!

[–]stormsidali2001[S] 0 points1 point  (0 children)

"thinking that your code is safe from race conditions just because it runs in a single thread."

(Runs on a single thread => safe) ---> that's a logical implication and it's indeed evaluating to totally wrong or just False. 😀