Friday, September 21, 2007

Mandelbrot Demo using a WorkerPool

from Ajaxian

Nick Edgar started to play around with the Workerpool component and decided to build a distributed Mandelbrot generator:

A UI/administrator task would farm out work (columns in the Mandelbrot set) to different worker tasks, possibly running on different machines. As each worker sent in its result, the UI would draw the column, and respond with more work for the worker. It was a cool example, and looked cool too: due to different machines running at different speeds, you would see the results kind of shimmer in, with faster machines generating the leading edge, and slower machines trailing and filling in the blanks.

He put together a demo using Workerpool and without to compare.

After you start the simulation, click on the toggle button to see how the UI can remain responsive in the Workerpool case. Although you would be foolish to rush to use Workerpool thread for every little thing you do, it is nice to have this in the arsenal for truly long running actions.

Mandelbrot