DragonFly kernel List (threaded) for 2004-04
[
Date Prev][
Date Next]
[
Thread Prev][
Thread Next]
[
Date Index][
Thread Index]
Re: serializing token
: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]