]> www.infradead.org Git - mtd-utils.git/commit
ubi: tests: Speedup io_paral by using rand_r()
authorRichard Weinberger <richard@nod.at>
Mon, 22 Feb 2016 13:52:05 +0000 (14:52 +0100)
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>
Tue, 21 Feb 2017 09:13:26 +0000 (10:13 +0100)
commitfc7aa01f07919155fc167846125bc8f7e965b89d
tree5d5fe930493bc5c3e192d6c64530ad30095e451b
parentfdec8a4ad3b166d83e00a04f9e926dc3261daf5d
ubi: tests: Speedup io_paral by using rand_r()

rand() is not thread safe, but glibc seems to use a shared state which is
protected by a mutex. io_paral spawns a few threads and they call rand()
more or less in parallel, which causes heavy lock contention. That
makes the test extremely slow on some setups.

Signed-off-by: Richard Weinberger <richard@nod.at>
Signed-off-by: David Gstir <david@sigma-star.at>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
tests/ubi-tests/io_paral.c