Skip to content Skip to sidebar Skip to footer

What Is Javascript Atomic Execution Unit For Events?

The Javascript engine is executing a function which in turn calls another function (sequentially) and this goes on for say 5s. Meanwhile, several events were triggered either by th

Solution 1:

Javascript is single threaded and events are queued in an event loop. JS code does not execute in parallel on the main thread. Code on the main thread is never interrupted.

That being said, it is possible to execute code in parallel with the use of web workers.

There are many excellent articles on the subject of the Javascript event loop, I would recommend starting here


Post a Comment for "What Is Javascript Atomic Execution Unit For Events?"