Messages in this thread | | | Date | Wed, 10 Nov 1999 18:01:31 +0100 (CET) | From | Ingo Molnar <> | Subject | Re: question: spinlocks and userspace. |
| |
On Wed, 10 Nov 1999, Andrea Arcangeli wrote:
> >additionally: if the data structure is never accessed from IRQ handlers > >then it's fast and safe to use a semaphore instead of a spinlock. > > You can access it also from irq handlers but you are allowed to use only > down_trylock(). (a similar things happens in show_buffers() in buffer.c > but with spinlocks)
yep you are right. This technique can be used for event-driven state machines, but cannot be used if the IRQ _must_ get access to that data structure. Ie. show_buffers() is fine, because the worst that can happen is that we do not see a debugging message.
-- mingo
- 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/
| |