Thursday, 1 February, 2018 UTC


Summary

First things first: JavaScript code being asynchronous does not implicate it running in more than one thread. So what does asynchronous mean exactly? Imagine making an Ajax request to fetch some data from the server. You won’t get a response immediately – you need to wait a little bit for the server to respond. What happens then is that other parts of your code are running while waiting for the response. If it weren’t for that, the interface would freeze, waiting with interpreting the rest of your code to the moment you get the response back – we don’t want that, do we?
The post When async is just not enough. An introduction to multithreading in the browser appeared first on Marcin Wanago Blog - JavaScript, both frontend and backend.