[Ilugc] what is spinlock

  • From: carti@xxxxxxxxxxxxxx (carti)
  • Date: Tue, 1 Jun 2004 10:59:01 -0500 (CDT)

Hi,
Can anyone who knows well explain with example
of what is spinlock?

I googled and went through some of the docs
which I could get. But I am not clear with them.

Something like the following it says.

spinlock like a semaphore but has no process list. And when
a process finds a lock closed by another process, its "spins"
around repeatedly, executing a tight instruction loop until the lock
becomes open.

I dont especially understand what is spinning and executing a
right instruction loop.

An explanation and perhaps a small example or algorithmic code
would be very helpful.

Thanks
carti

Other related posts: