0

I wanted to know if workers in JS are the same as threads? Is there really parallelism or it's just context switching?

RiskX
  • 561
  • 6
  • 20

1 Answers1

1

Web Workers is basically an HTML5 API that runs a named JavaScript file, which contains the code that will run in the worker thread. Web Workers provide a facility for creating new threads that can execute scripts concurrently, thus creating a multi threaded architecture in which the browser can accomplish multiple tasks asynchronously.

Muhammad Faizan Uddin
  • 1,339
  • 12
  • 29