The following piece of code will keep a specified number of threads running concurrently. The threads all execute the same method which could be any kind of "worker process".

The reason for this was performance issues on both multiple CPU's and CPU's with hyperthreading. From my tests, a dual-CPU server would run most efficiently when 4 threads were running concurrently. The processing speed would be 3 times faster than when running 1 thread.

                Thread[] Threads = new Thread[THREAD_COUNT];

                int RunningThreads = 1;
                int IdleThreadIdx = 0;

                while (RunningThreads > 0)
                {
                    // Start a new thread while an idle thread slot is available
                    if ((IdleThreadIdx < THREAD_COUNT) && (!_Stopping))
                    {
                        // It is assumed that this thread will terminate within 1000ms if it has no work to do.
                        Threads[IdleThreadIdx] = new Thread(new ThreadStart(ProcessEvents));
                        Threads[IdleThreadIdx].Start();
                    }
                    Thread.Sleep(1000);

                    // Search for the first idle thread, and check number of idle threads:
                    IdleThreadIdx = int.MaxValue;
                    RunningThreads = 0;

                    for (int i = THREAD_COUNT - 1; i >= 0; i--)
                    {
                        if ((ThreadsIdea != null) && (ThreadsIdea.IsAlive))
                        {
                            RunningThreads++;
                        }
                        else
                        {
                            IdleThreadIdx = i;
                        }
                    }
                }

 Note that the worker method "ProcessThreads" must not throw an exception, otherwise it seems that the calling application (in my case a Windows service) will be terminated without an exception.