Skip to contentSkip to conversation

Network slowdown due to CFS

DISCUSSION Hubert Tonneau 1 participant 1 message Oct 1, 2007

lore
Share & tools
lore
#0 lore raw
Quoted 3 lines · Ingo Molnar

Really, i have never seen a _single_ mainstream app where the use of sched_yield() was the right choice.

Pliant 'FastSem' semaphore implementation (as oppsed to 'Sem') uses 'yield'
http://old.fullpliant.org/

Basically, if the ressource you are protecting with the semaphore will be held for a significant time, then a full semaphore might be better, but if the ressource will be held just a fiew cycles, then light aquiering might bring best result because the most significant cost is in aquiering/releasing.

So the aquiering algorithm for fast semaphores might be:
try to aquire with a hardware atomic read and set instruction, then if it fails, call yield then retry (at least on a single processor single core system).