Replies: 2 comments
-
Javascript is single threaded, but can do things asynchronously. If everything is done synchronously in a single thread, I suppose that a race condition isn't really possible. But what about if something is single threaded and asynchronous? What is the asynchronous unit in Javascript? Is the unit a single line of code? For example, one line of code somewhere runs and then another line of code from a completely different function runs? Or is the unit a function? So that one function runs and then potentially a separate function runs? I've read that the asynchronous unit is a function. So if that's true and we can have different asynchronous functions running perhaps in unexpected orders, how could that create a race condition? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Are race conditions in Javascript possible? How?
Beta Was this translation helpful? Give feedback.
All reactions