add sched_yield in RWTicketSpinLock
authorNathan Bronson <ngbronson@fb.com>
Thu, 19 Jul 2012 20:33:29 +0000 (13:33 -0700)
committerJordan DeLong <jdelong@fb.com>
Thu, 2 Aug 2012 08:54:34 +0000 (01:54 -0700)
commit1805d922175a0cb620461f8873f6a7061a683413
treea0b6b85f243e3dbbef6cc868f0736d157be42573
parent9aa33f6ae63248816b9b5d7286f2d1740027d1d3
add sched_yield in RWTicketSpinLock

Summary:
This diff makes RWTicketSpinLock eventually start calling
sched_yield() during shared and aggressive exclusive lock access, to
avoid pathologies that can arise when the number of threads far
exceeds the number of actual cores.

Test Plan:
1. unit tests
2. benchmark w/o + w/ diff

Reviewed By: nathan@fb.com

FB internal diff: D524897
folly/RWSpinLock.h