Skip to content
Related Articles

Related Articles

Why doesn’t JavaScript support multithreading?

View Discussion
Improve Article
Save Article
Like Article
  • Last Updated : 18 Jul, 2019

What is Multithreading?
Multithreading is a sort of execution model that enables different threads to exist inside the setting of a process with the end goal that they execute autonomously yet share their process resources. A thread keeps up a rundown of data important to its execution including the priority schedule, exception handlers, a set of CPU registers, and stack state in the location space of its hosting process.

Why doesn’t JavaScript support?
As you may most likely know, JavaScript is single-threaded. To explain better, this implies one single thread handles the event circle. For more established browsers, the entire browser shared one single thread between every one of the tabs. Present-day browsers enhanced this by utilizing either process-per-site-case or various threads per tab. Albeit devoted threads improved the responsiveness of pages, regardless it left every tab unable to deal with different scripts running at once.
Indeed, even Google Chrome won’t let a solitary website page’s JavaScript run simultaneously on the grounds that this would cause enormous concurrency issues in existing web pages. All Chrome does is split various components (various tabs, modules, etcetera) into discrete processes, yet none can’t envision a solitary page having more than one JavaScript thread.

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!