开发者

SIGPROF on darwin

setitimer + sigprof doesn't work on 64 bit darwin.

References:

http://openradar.appspot.com/9336975

http://lists.apple.com/archives/Unix-porting/2007/Aug/msg00000.html

Given this, what's the recommended way to build a time based, sampling profiler on darwin? In a mu开发者_JS百科ltithreaded environment.


I ended up creating a separate profiler thread that sleeps for intervals and pthread_kills all other threads with SIGPROF. The SIGPROF handler looks at the how much cpu time the thread consumed and punts if it's too little.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜