Re: Question about sched_yield()

Rob Landley (landley@trommello.org)
Tue, 18 Jun 2002 12:58:09 -0400


On Tuesday 18 June 2002 03:11 pm, David Schwartz wrote:

> I'm sorry, but you are being entirely unreasonable. The kernel has no way
> to know which processes are doing something useful and which ones are just
> wasting CPU.

So the fact one of them is calling sched_yield (repeatedly) and the other one
isn't doesn't count as just a little BIT of a hint?

> What sched_yield is good for is if you encounter a situation where you
> need/want some resource and another thread/process has it. You call
> sched_yield once, and maybe when you run again, the other thread/process
> will have released it.

Not if it was a higher-priority task that has already exhausted its time
slice...

> You can also use it as the spin function in
> spinlocks.

In user space?

Rob
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/