Heh... almost exactly what I did in
my recent Linux Magazine column, right down to the 4-byte length header!
And there's some reusable code in there that you can steal, to do "hungry puppies" pre-forking.
-- Randal L. Schwartz, Perl hacker
Update: a better explanation of just the forking queue manager is in
the previous column, but check the above-referenced column for the final code.