Say, I want to increment a counter every time I get an ajax response. I don't know about the concurrency model with JavaScript async events. Any thoughts?
Within a browser, there is only ever one javascript thread running at a time.
Concurrency issues are possible in that while an ajax response is pending, javascript may run in response to an unrelated event. But you are safe if you do not start an operation intended to be atomic before an ajax call and finish it in the response handler.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With