Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Jun 2009 13:43:04 -0500
From:      Dan Nelson <dnelson@allantgroup.com>
To:        Yuri <yuri@rawbw.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: top shows that multithreaded program uses 19623.14% CPU
Message-ID:  <20090613184303.GK56070@dan.emsphone.com>
In-Reply-To: <4A33544C.1070902@rawbw.com>
References:  <4A33544C.1070902@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
In the last episode (Jun 13), Yuri said:
> I ran then program with 1500 threads and in top it looked the this:
> 
>  PID USERNAME    THR PRI NICE   SIZE    RES STATE   C   TIME    CPU COMMAND
> 20382 yuri       1500  99    0   641M   462M umtxn   0   0:00 19623.14%  quicksort
> <skipped further>
> 
> Where can I read how CPU column is calculated?
> 
> Some time ago I saw another weird fenomenon when CPU column: 5% CPU load 
> for the pocess that just cycles in CPU.

Top doesn't seem to show the right %CPU at all for threaded apps unless you
hit H to view each thread individually.  Then you get accurate numbers (but
you have to manually sum up the threads usage if you want to see the total
%CPU for an entire process).

-- 
	Dan Nelson
	dnelson@allantgroup.com



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20090613184303.GK56070>