:Matt
:
:Ok I see..the interlock is a lock on a collection (e.g
:on vfs mount list) and it can be released once the simple
:lock within the to-be-locked object has been acquired.
:These are really spin locks, now that I saw simplelock.s
:
:One more clarification if you will.. :-)
:
:What is the purpose of the "splhigh" in acquire() ?
:
:Is it this that prevents an involuntary context switch in
:a UP system , while the lock variables are being modified 
:by acquire() ?
:
:-Sandeep

    In -stable there are no involuntary context switches in kernel mode
    and only one cpu can truely be running kernel code at any given
    moment, but interrupts can still preempt (temporarily) the mainline
    code.  So all you need to protect against are interrupts.  splhigh()
    effectively disables interrupts - because an interrupt might call code
    that conflicts with the mainline code in question.  There are places in
    the mainline code that interrupts never touch where the mainline code thus
    does not bother to use splhigh() or any spl*() stuff at all.  There
    are other places in the mainline code that are also called from
    interrupts and that is where the spl*() protection is required.

    In -current the situation is vastly different.  Involuntary 
    context switches can occur at almost any time and more then one
    cpu may be running kernel code at any given instance, so structures
    must be protected by mutexes at all times. 

                                        -Matt


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message

Reply via email to