tech-kern archive

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

Re: rw_lock vs mutex



On Feb 2, 2012, at 5:38 PM, Paul Goyette wrote:

> While digging around looking into another problem, I noticed that the 
> piixpm(4) driver uses an rw_lock for its ic_acquire_bus/ic_release_bus 
> routines.  ic_acquire_bus() uses rw_enter(..., RW_WRITER) and there doesn't 
> appear to be any use anywhere of RW_READER for that lock.
> 
> The man page for rw_lock implies that it is a superset of a mutex.  So I'm 
> wondering if it makes any sense to use the simpler mutex instead?

Switch to a mutex, it's much less overhead that a r/w lock


Home | Main Index | Thread Index | Old Index