Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

tonybai

macrumors newbie
Original poster
Apr 29, 2010
2
0
Hi,
I can got the CPU usage of process by Active Monitor or top or htop. But I don't know how to get the CPU usage of thread.
Who can help me? Thanks
 
Hi,
I can got the CPU usage of process by Active Monitor or top or htop. But I don't know how to get the CPU usage of thread.
Who can help me? Thanks

Do you mean in your own threaded application code?
What programming language are you using? What are you using to create threads?
 
Do you mean in your own threaded application code?
What programming language are you using? What are you using to create threads?

I need a tool to get the CPU usage of thread. Forexample, I write an multi-thread program with c++. This process cost 100% CPU, I want to know which thread in this process cost most CPU.
 
Shark can do this (set it to "all thread states" mode).

I have used Shark, it can not do it. It can not show the CPU usage of thread, it just give some statics about function. We can know one function cost many CPU, but if this function was called by many threads, how can I know which thread call this function frequently? I want to know the thread, not the function.
 
I need a tool to get the CPU usage of thread. Forexample, I write an multi-thread program with c++. This process cost 100% CPU, I want to know which thread in this process cost most CPU.

If for example Activity Monitor shows "100%" then your application isn't multi-threaded, at least there are no two threads running at the same time.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.