serializing token

Matthew Dillon dillon at apollo.backplane.com
Sat Apr 24 11:09:09 PDT 2004


: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







More information about the Kernel mailing list