Threads have noticeable overhead on 32-bit systems, so using fewer threads for simple tasks is better than starting up threads willy-nilly.
The first commit implements a simple task queue class (CScheduler) which can be serviced by one or more threads.
The second and third port the networking code’s DumpAddresses thread to be a task instead.
Porting other threads (ThreadFlushWalletDB is a good candidate) is left as an exercise for future pull requests.
The CScheduler class was developed and tested with code here: https://github.com/gavinandresen/scheduler (see main.cpp)
I tested the DumpAddresses change running with -debug=net and a hacked DEBUG_ADDRESS_INTERVAL, and made sure I got more than one “Flushed %d addresses to peers.dat” in my debug.log.