• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

Web Workers

Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Rob,

I've heard web workers in HTML 5 does something similar to Threads in Java or another programming language. Where or what kind of real world scenarios can benefit from Web Workers?

G Sunderam
Posts: 297
Android Firefox Browser Fedora
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any time when you need to do processing in JavaScript that would last for a noticeable amount of time (ie. greater than 1/10th second) but not require access to the DOM (WebWorkers do not have access to window or document). WebWorkers communicate back to the parent web page through a message passing mechanism so it is easy to swamp any performance gains made through background processing in copying data between the two threads if you have a large dataset, however WebWorkers do have access to Ajax so if you wanted to request a large block of data from a server, do some complex processing and then deliver a relatively small result set to the page that would be an ideal scenario for them. There are some code examples in the spec which you may find helpful.
pie. tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic