DragonFly BSD
DragonFly kernel List (threaded) for 2004-04
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Re: serializing token


From: Matthew Dillon <dillon@xxxxxxxxxxxxxxxxxxxx>
Date: Sat, 24 Apr 2004 11:08:10 -0700 (PDT)

:Don't forget that tokens are inter-CPU synchronisation primitives.
:You can always acquire a token in the interrupt thread if it was
:hold by the preempted thread. This is in fact the supposed and optimized
:case.

    Actually you can't.  I explicitly wanted tokens to protect against
    preemptive interrupts obtaining the same token, so an interrupt
    thread cannot acquire a token held by the thread it preempted.

:For guarantying atomicy in this case, use either splXXX or crit_enter,
:depending on the concrete code path.
:
:Joerg

    This is still true, though the atomicy that is being protected here is
    mostly the atomicy of access to the per-cpu globaldata structure.

						-Matt





[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]