javascripthtmlweb-worker

Since JavaScript is single-threaded, how are web workers in HTML5 doing multi-threading?


I've been reading about web workers in HTML5, but I know JavaScript is single-threaded.

How are web workers doing multi-threaded work then? or how are they simulating it if it's not truly multi-threaded?


Solution

  • As several comments have already pointed out, Workers really are multi-threaded.

    Some points which may help clarify your thinking: