lkml.org 
[lkml]   [1999]   [Sep]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: spin_lock and linux philosophy question...
    On Mon, 13 Sep 1999, Robert Dinse wrote:

    > On Mon, 13 Sep 1999, Momchil Velikov wrote:
    > >
    > > You can also use a spinlock in an interrupt handler, where you can't sleep at
    > > all.
    > >
    > > Regards,
    > > -velco
    >
    > Are there ever cases where you lock outside of interrupts but expect code
    > inside of an interrupt handler to unlock? Or conversely, cases where you lock
    > during an interrupt, do some preliminary work, then return expecting code
    > outside to unlock?

    Not with spinlocks. Which is to say that:

    a) a process may never block while holding a spinlock
    b) an interrupt context may never end while still holding a
    spinlock

    I'm not too sure what the debugging spinlock code does wrt these
    invariants, but checking a local lock depth wouldn't be too difficult.

    -ben


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

    \
     
     \ /
      Last update: 2005-03-22 13:53    [W:0.025 / U:0.728 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site