Monday, January 25, 2010

Fast track to a massive parallel computer

The vast majority of people who will read this have Adobe Flash installed. (Most will probably have Adblock or Flashblock installed, which has relevance, but not that much)

I've been thinking about parallel computation for for a while, and looking at different ways to do it. The best explicitly-known parallel computation setup out there are the @home projects like SETI@Home and folding@Home. These projects divide their workload into chunks, pass those chunks around, and programs running on volunteers' computers take these chunks, chew on them and pass them back.

A few weeks ago, I had the idea that someone could distribute an @home-style client as a flash applet using the one distribution mechanism many of us already hate--website banner ads. Have a flash applet distributed via advertising networks that:

  1. Connects to a central server

  2. Grabs a data chunk

  3. Chews on it

  4. Uploads the results to the central server


Flash already allows applets to pull remote files and perform GET requests. (I don't know about POST, though.) All that remains is grabbing and running the workload, and have a server that can verify that the workload results are uncorrupted. (i.e. not tampered with.)

Yes, this results in spinning an end-user's processors more than they would be otherwise, which may cost them a few more cents per month on their electric bill, or a notable reduction in their laptop's battery life. It would be helpful if Flash had a mechanism to change applet resource consumption based on system power state and/or user preferences. Still, yes, it's coopting a user's computer to do something they didn't explicitly agree to. Someone else can deal with the ethics; I'm just spouting an idea.

Also, yes, a large number of pages are only loaded for a very short period of time; The amount of time required to process a chunk of work may well require more time than the page will be loaded (and, thus, more time than the applet will be running). There's a workaround for that, too. First, Flash allows applets from any given domain to store a configurable amount of non-volatile data on the user's machine; That could be used as a data store for intermediate state. Second, the applet could wait a couple minutes before beginning the number crunch, looking for times when a page is left loaded for an extended duration. (Quite likely on sites like Youtube, Pandora and others with streaming media.)

No comments:

Post a Comment