ALERT

[FREE DEMO] Deploy Your Enterprise Cloud in Minutes

Web Workers

Definition - What does Web Workers mean?

Web workers is a new application programming interface being developed for HTML5 that allows software processes to run in background threads. Web workers are created on the client. They run parallel to, and are unusually created by, the processes responsible for the user interface (UI). Once created, Web workers can communicate with their parent creator by sending messages to specified event handlers of the UI defined by the parent.

Web workers are technically known as the Web workers API. Most major browsers (except Internet Explorer 9) support the functionality.

Techopedia explains Web Workers

The Web workers API specifies two kinds of workers - the dedicated worker and the shared worker. The dedicated worker is the simplest; it is designed to perform and complete some sort of task. An example might be a clock that is updated on a user screen. The dedicated task fires in the background, does the clock update and ends.

A shared worker is more complicated in that it has the ability to communicate by replying back via an event handler function. An example might be the validation of user address and phone info on a registration screen. Each piece of data must be verified. When the results are complete, they are handed off to the page, so that it knows that all the user's data is valid and it can continue with the registration process.

Web workers have a lot of promise for improving the user experience of Web-based programs. The speed with which a browser screen can be updated is increased significantly because there are now multiple processes doing the updating.

However, there are still some things that need to be worked out. First, thread safety and concurrency can be a problem. Remember, these are client-side processes that are actually using back-end Web servers to call OS-level threads on the client. By definition, there is not much standardization here.

Secondly, a Web worker is passed a uniform resourse identifier (URI) of the script to execute when it is created. These URIs should pass the same-origin policy that has been developed in response to client-side security concerns, although there is currently some disagreement among browser vendors as to whether these URIs need to pass this same sniff test.

Finally, packets of info passed back for shared Web workers must be serialized, which can be a slow process. At some point, the efficiency of using a Web worker must be offset against the processing time of serializing.

Techopedia Deals

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Tweat cdn.techopedia.com
"Techopedia" on Twitter


'@Techopedia'
Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Resources
The 4th Era of IT Infrastructure: Superconverged Systems
The 4th Era of IT Infrastructure: Superconverged Systems:
Learn the benefits and limitations of the 3 generations of IT infrastructure – siloed, converged and hyperconverged – and discover how the 4th...
Approaches and Benefits of Network Virtualization
Approaches and Benefits of Network Virtualization:
Businesses today aspire to achieve a software-defined datacenter (SDDC) to enhance business agility and reduce operational complexity. However, the...
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.