Skip to contentSkip to conversation

schedule while atomic

DISCUSSION Brian O'Mahoney 1 participant 1 message Jul 12, 2005

lore
Share & tools
lore
#0 lore raw

More importantly _exactly_what_ are you using the LOCK to protect?

Short recap, spinlocks are used to serialise, ie prevent races in SMP systems, where turning the interrupts off, on a single processor, is NOT good enough to prevent races between interrupt-handlers and core kernel code accessing shared-common-data eg managing a linked list where the data structure would be mangled by shared access; thus the lock should be taken and released _for_the_shortest_time_possible_ eg

get lock
unlink head of list
give lock

and so on, so get the lock only when you need it, and give it back as soon as the transaction is done; also design the data-structure so that complex, long lasting transactions are un-necessary.

see also RCU.

Signature · 1 line
mit freundlichen Grüßen, Brian.