[PATCH 06/11] Add lock elision to rwlocks

Andi Kleen andi@firstfloor.org
Thu Jun 13 17:50:00 GMT 2013


> We cannot use elision for trywrlock() or wrlock() because this would
> change the semantics and violate POSIX semantics.  See the guidelines.
> Just using elision in rdlock and tryrdlock is okay.

The rwlock implement the same semantics now, as the normal locks.
Only when you set elision explicitely in the program does the
write lock elide. The read lock always elides.

I didn't make this clear in the description, but that is what the 
current code does. I'll fix the description.

-Andi



More information about the Libc-alpha mailing list