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.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论