Under no pthread_yield android ndk, good std :: this_thread :: yield () can achieve the same effects

A multi-threaded algorithm, it was found that only about 47% thread utilization, a lot of processing time because usleep (500) which causes the thread to sleep;
performance is always stagnant.

After the usleep (500) modified to std :: this_thread :: yield (), program performance increased by 20% thread utilization rate of 76%.

Guess you like

Origin www.cnblogs.com/ahfuzhang/p/11639811.html