tech-kern archive

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

Re: mutexes, locks and so on...

On 11/17/10 13:55, Thor Lancelot Simon wrote:
On Wed, Nov 17, 2010 at 01:31:51PM +0100, Johnny Billquist wrote:

But you could perhaps argue that this is a bug in itself, and
mutex_vector_enter should not take a spin mutex on its own when a
mutex_spin_enter function exist.

I don't think that's right.  I don't believe spin mutexes are _required_
to be taken with mutex_spin_enter() -- mutex_enter() should work fine.
It has to, because it is supposed to be invisible to the programmer
whether mutexes are spin or adaptive, except for the initial IPL used
to allocate them.

At least, that is how I understand it.  Which may be wrong.

You misunderstood me. :-)
If code would have called mutex_enter, I can handle it correctly.
It is that mutex_vector_enter can also take a spin mutex, and it will not take it the same way as mutex_spin_enter (or mutex_enter) will do it. mutex_vector_enter has it's own spin mutex enter code, which if invoked, means that mutex_enter and mutex_spin_enter cannot actually have their own implementation, but must in fact be the same as the one in mutex_vector_enter.


Home | Main Index | Thread Index | Old Index