LWN.net Logo

What is a spinlock?

What is a spinlock?

Posted Jan 30, 2003 22:54 UTC (Thu) by corbet (editor, #1)
In reply to: What is a spinlock? by perlid
Parent article: Fast reader/writer locks

A spinlock is a lightweight lock with no wait queues; if there is contention for the lock one (or more) threads will "spin" (busy-wait) until the lock is free. They are usually built with some sort of atomic test-and-set instruction; a quick look in the kernel source will show how they are done for any particular architecture.


(Log in to post comments)

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds