Multithreading and HTML5

HTML, the markup language of the internet, is undergoing a major revision that aims to create a language better suited to today’s web applications. HTML5 is edging towards completion, and many of the features are considered stable enough for immediate use (where supported by browsers).

One of the features that caught my attention was the introduction of web workers, which will be used to run scripts in the background. While workers do not support highly granular tasks, they are recommended for tasks with a high startup performance cost and a high per-instance memory cost.  They enable these tasks to continue without interruption from user interface events, and without making the user interface appear to be unresponsive.

The draft API includes several example implementations, ranging from a simple background number-cruncher, through the use of workers for updating client-side databases in the background, to the delegation of a large workload to ten separate workers. This latter case, in particular, could make it easier to exploit the CPU’s full potential on computationally intensive tasks. Although the examples are concerned mostly with mathematical calculations, this approach could equally be applied to graphics calculations. Google recently demonstrated the power of the cloud, but this approach won’t always be available or appropriate for developers, who still have a lot of untapped desktop PC power.

What are your thoughts on the use of web workers? Will they enable us to get the best results for our web applications? Where will it leave tools like Fan (now called Fantom) and Stratified Javascript? Feel free to leave your comments below.

3 Responses

  1. […] year, I wrote about how the group of technologies loosely dubbed HTML5 will make it easier to create multithreaded web a…. Today, I came across a compelling demonstration from Google. It’s a fractal generator that can […]

  2. […] and does so in a standards-compliant way. Of particular interest to parallel programmers is the web workers feature of HTML5 which enables scripts to run in the background, and starts to introduce deliberate […]

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: