Exploring BlockingQueue#

I was inspired by some code I looked at to play around in Java with BlockingQueues.

I wrote a trivial application which uses the following algorithm:

  • generate events and put them in an event queue
  • simultaneously, read events from the queue and decompose them into flavors, assign each flavor to a new work queue
  • simultaneously, drain work queues in parallel

When running the application you can experiment with different values for the number of events, the maximum size of the BlockingQueues used by the event queue and the workers.

Binary and source code:

threadrunner-20100210.jar (2010-02-10 @ 20:33:27 PST)

I've created an incredibly boring video to go with this. It reminds me of an ancient algorithmic MIDI note generator I once loved.

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-6) was last changed on 13-Jul-2010 21:27 by scott  
Welcome (anonymous guest) Wiki Prefs

GeneticMail

Loading...

JSPWiki v2.8.4-svn-13