Re: > Re: Linux threads -- as seen in NT Magazine

Richard Gooch (rgooch@atnf.csiro.au)
Thu, 17 Dec 1998 10:35:20 +1100


Jamie Lokier writes:
> On Wed, Dec 16, 1998 at 12:02:33PM +1100, Richard Gooch wrote:
> > Say spin 5 times, then loop with sched_yield() 5 times, then go to
> > sleep (block in kernel).
>
> Spin just 5 times? Is this with a CPU delay between spins?
> I'd have thought it wasn't enough if there's no delay.

No delay. The lock/unlock operations provide more than enough
delay. You can pack a fair number of normal instructions into a
spinlock operation.
If all you're doing is inserting an entry into a list, for example,
that is an operation that could probably fit into on lock/unlock
cycle.

Regards,

Richard....

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