The bge driver demonstrates using cyclics for periodic timers (Search
for cychand in bge_attach()). It does seem much simpler with respect to
locking than timeout. On the other hand, this is not DDI compliant so
may change. Anyone have any idea when/if the cyclic APIs are going to
be documented?
max
Paul Durrant wrote:
On 3/28/07, Tom Chen <[EMAIL PROTECTED]> wrote:
Guys, thanks for your help! Finally I find that this is because one
thread holding mutex is preempted by a high priority timer (soft)
interrupt which also seeks the same mutex. thus dead lock happens.
This alone should not be a problem. Unless your interrupt is high
priority, there's nothing wrong with grabbing a mutex at interrupt
level that's used elsewhere. Your use of timeout() is probably the
problem; you need to be very careful:
Don't take a lock within your timeout function that's held across
schedulng it. That can lead to precisely the sort of cycle you're
experiencing. (I think there's some notes on the timeout() manpage
about this). Self re-scheduling using timeout() can be very tricky. If
this is what you're doing then consider switching to use a cyclic
function (see cyclic.h).
Paul
_______________________________________________
networking-discuss mailing list
[email protected]