Re: spin_lock and linux philosophy question...

Momchil Velikov (velco@fadata.bg)
Mon, 13 Sep 1999 16:45:59 +0300


Robert Dinse wrote:
<snip>
> But that brings up a larger question of why there are spin locks at all?
> If a CPU can't be doing one thing because a particular resource is unavailable
> being used by another CPU, why isn't it then sent off to do something else?
Spin locks are for cases when it is expected the lock to be held for
very short intervals, thus saving the sleep/wakeup overhead. For other
cases there are sleep locks (whatever they are called in each OS), where
indeed the CPU is sent to do something else.

Regards,
-velco

-
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/