Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
pthread_cleanup_pop_restore - 它是什么?
它来自 glibc。而且调用太频繁,会占用大量cpu时间。
该程序使用了大量的 getc() 调用。我无法更改程序(它是具有固定源的基准测试),但想让它运行得更快。
这是一个功能!
反过来,将从pthread_cancel的清理队列中注销清理功能。当 glibc io 函数(在 glibc 中启用文件锁定)将被 pthread_cancel 中断时,它只有一次机会解锁文件描述符。这个机会就是这个函数的对应物。
pthread_cancel