Resume: MS Word (.doc) (sha512) OpenOffice (.odt) (sha512) - Murex Mx.3, Java, UNIX/Linux.

23-Feb-2010 11:06
BlockingQueues and Thread Pools#
I've reworked the previous BlockingQueue example to use a thread pool. Suppose you wanted to decompose your input into a large number of different types, you would end up with an excessive number of threads if you tried to have one thread for each type. The example code below uses the poll method of BlockingQueue with a timer. When the poll expires, the thread wrapping the worker is interrupted and is returned to the thread pool to be reused.
11-Feb-2010 04:52
Brilliant Essay on Computer Programming#
"A Few Billion Lines of Code Later: Using Static Analysis to Find Bugs in the Real World" is brilliant. Every programmer needs to read this.

The analysis of the human factors involved in software development is spot on.

09-Feb-2010 04:53
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.

New entry


Changes Today#

Recent Changes


Add new attachment

Only authorized users are allowed to upload new attachments.

List of attachments

Kind Attachment Name Size Version Date Modified Author Change note
pdf
ebondtrade.pdf 42.2 kB 1 06-Mar-2006 16:27 scott
png
tinylock.png 0.2 kB 1 22-Sep-2006 22:47 scott
« This page (revision-40) was last changed on 06-Dec-2009 06:00 by scott  
Welcome (anonymous guest) My Prefs

GeneticMail

Loading...

JSPWiki v2.8.4-svn-3