login
Header Space

 
 

RE: Two questions about scheduling and threading.

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <linux-kernel@...>
Date: Thursday, May 8, 2008 - 3:44 pm

> 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


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Two questions about scheduling and threading., Brian McGrew, (Thu May 8, 11:15 am)
RE: Two questions about scheduling and threading., David Schwartz, (Thu May 8, 3:44 pm)
speck-geostationary