pthread_cleanup_pop_restore - what is it?
It is from glibc. And it is called too often and eats a lot o开发者_如何学Cf cpu time.
The program uses a lot of getc() calls. I can't change the program (it is the benchmark with fixed source), but want to make it run faster.
It is a function!
which in turn, will deregister cleanup function from pthread_cancel
's cleanup queue. When glibc io function (with file locking enabled in glibc) will be interrupted by pthread_cancel, it will have a only chance of unlocking file descriptor. This chance is the this function counterpart.
精彩评论