M
M
Mikhail Rybakov2015-07-17 15:11:57
JavaScript
Mikhail Rybakov, 2015-07-17 15:11:57

How to avoid blocking the execution of JS code?

How can we avoid blocking script execution if we currently have some complex processing going on?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
D
Denis Ineshin, 2015-07-17
@mrybakov

JS is single-threaded, so in a normal situation you won't be able to do this. Any complex calculation will block script execution for some time. Therefore, the only solution is to move the calculation to another place. Web workers are used for this (as colleagues have pointed out). But unfortunately the technology is relatively new and you can't do anything in IE < 10

D
Dmitry Filimonov, 2015-07-17
@DmitryPhilimonov

Worth a look at web workers. https://developer.mozilla.org/en/docs/DOM/Using_we...

R
Roman Akhmadullin, 2015-07-17
@saggid

Use web workers 's - part of the HTML5 standard - to solve this problem .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question