Skip to content

Commit 847fb99

Browse files
gonnetxnnpack-bot
authored andcommitted
Don't yield-loop before waiting on a condition.
Unless we're on Android, where sleeping/waking is slow. PiperOrigin-RevId: 708363228
1 parent c02f903 commit 847fb99

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

src/threadpool-common.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,9 @@
5656
#define PTHREADPOOL_SPIN_YIELD_ITERATIONS 10
5757
#define PTHREADPOOL_SPIN_PAUSE_ITERATIONS 100000
5858
#else
59-
#define PTHREADPOOL_SPIN_YIELD_ITERATIONS 10
60-
#define PTHREADPOOL_SPIN_PAUSE_ITERATIONS 100
59+
60+
#define PTHREADPOOL_SPIN_YIELD_ITERATIONS 0
61+
#define PTHREADPOOL_SPIN_PAUSE_ITERATIONS 1000
6162
#endif // defined(__ANDROID__)
6263
#define PTHREADPOOL_SPIN_WAIT_ITERATIONS \
6364
(PTHREADPOOL_SPIN_PAUSE_ITERATIONS + PTHREADPOOL_SPIN_YIELD_ITERATIONS)

0 commit comments

Comments
 (0)