Menu

#13 Deadlocks with HbaApiLib.c

open
nobody
5
2014-07-09
2004-10-18
No

We ran into a deadlock situation with multiple threads
while using particularly port state event callbacks, but
my guess is that this can happen with just about any of
the registration / callback handlers. The one we were
using was adapterportstateevents_callback, which had
another bug previously reported.

Now, what happened is that the application's main
thread was registering for these callbacks in a multiple
adapter installation on a HyperThreading capable
processor. As soon as the first adapter's callback got
registered, a callback occurred in another threadd on
this adapter and IT locked the APSE mutex. Our
callback function in turn called another HBA API function
that attempted to lock the LL mutex. But the main
thread was in the process of registering callbacks and IT
had the LL mutex locked and was trying to get the APSE
mutex that the other thread had locked.

OUR solution was to first lock the LL mutex in any of the
callback functions that lock the other mutexes.

I don't recall seeing anything in the documentation that
said calling back into the HBA library was illegal from a
callback function.

Discussion


Log in to post a comment.

MongoDB Logo MongoDB