test-io-stream-common: Avoid CPU starvation by yielding
authorOle André Vadla Ravnås <oleavr@gmail.com>
Thu, 4 Nov 2021 21:48:22 +0000 (22:48 +0100)
committerOlivier Crête <olivier.crete@ocrete.ca>
Mon, 22 Nov 2021 21:53:08 +0000 (21:53 +0000)
commit216909011efa8eef6089f311e5046032719c73cb
treed8692a4f985416283e4fdfecd82dac873f2dc4a6
parent751e8f584cb5fd2d5b1643aed92822df23888bd7
test-io-stream-common: Avoid CPU starvation by yielding

Busy-looping is not a good idea, especially not when run under Valgrind,
where such a thread may result in well-behaved threads running thousands
of times slower. While passing --fair-sched=yes to Valgrind avoids the
issue, it's still better to make our busy-looping less aggressive.
tests/test-io-stream-common.c