> When I start my system for the first time, I start one thread for each
That's not unreasonable. However, you may wish to create a few extra
threads. Otherwise, if one thread is blocked on I/O, you can't use all the
CPUs.
Sounds like a bug. What does your wakeup code look like? Do you put your
threads to sleep blocked on a condition variable? Is the c.v. code correctly
using a predicate, that's something easy to screw up. It's like 'select',
there's a dozen classic mistakes and someone often makes one or two of them
and their code still soemtimes works.
Big mistake. If you bind threads to CPUs and the thread that gets a wakeup
is assigned to a CPU that's busy, the job that thread was going to do will
have to wait, while other CPUs sit idle.
DS
--