From owner-freebsd-current@FreeBSD.ORG Wed Apr 13 05:32:56 2005 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6A08C16A4CE for ; Wed, 13 Apr 2005 05:32:56 +0000 (GMT) Received: from rproxy.gmail.com (rproxy.gmail.com [64.233.170.204]) by mx1.FreeBSD.org (Postfix) with ESMTP id EF9E443D45 for ; Wed, 13 Apr 2005 05:32:55 +0000 (GMT) (envelope-from leafy7382@gmail.com) Received: by rproxy.gmail.com with SMTP id a41so64944rng for ; Tue, 12 Apr 2005 22:32:55 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:mime-version:content-type:content-transfer-encoding:content-disposition; b=UxYsdWAnOTq66s6A3EVe4As5sApZFpwlvXGul86NlrXrJftBW/sOdfdtgOT48MKyhRGj9TEMJQZxBXoCcbTXIqvZGdReUQxgL59DoALvIFBQYhwzgzSAprRHfFx0fuTJI1K7q+5Ohts0izW8ws9ZNpQxTayeZT4u70spT2K1jec= Received: by 10.38.74.31 with SMTP id w31mr266018rna; Tue, 12 Apr 2005 22:32:55 -0700 (PDT) Received: by 10.38.22.48 with HTTP; Tue, 12 Apr 2005 22:32:55 -0700 (PDT) Message-ID: Date: Wed, 13 Apr 2005 13:32:55 +0800 From: Jiawei Ye To: freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Subject: How does one know how many thread a process owns? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Jiawei Ye List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 13 Apr 2005 05:32:56 -0000 >From top in pkgsrc, one can know that a certain process has some number of LWP in it. load averages: 1.89, 1.72, 1.68; up 119+05:28:10 13:3= 0:48 154 processes: 152 sleeping, 1 running, 1 on cpu CPU states: % idle, % user, % kernel, % iowait, % swap Memory: 1024M real, 414M free, 841M swap in use, 1956M swap free PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND 21891 bond 1 4 2 19M 1864K run 31.7H 77.04% upd_twd_15min 17153 bond 1 50 2 82M 6164K sleep 37:37 12.98% dataserver.ts= k 17151 bond 1 53 2 82M 81M sleep 41:57 0.96% dataserver.ts= k 13742 otc 1 53 2 30M 21M sleep 3:31 0.89% dataserver.ts= k 17204 mtrs 1 53 2 82M 6144K sleep 2:47 0.67% dataserver.ts= k 17321 mtrs 1 53 2 25M 7908K sleep 2:21 0.49% otcmgr.tsk 16250 root 1 59 0 4136K 2224K sleep 0:00 0.47% sshd 13745 otc 1 53 2 30M 2496K sleep 2:55 0.36% dataserver.ts= k 3821 jessica 1 59 0 31M 4816K sleep 6:25 0.34% dataserver.ts= k 17227 bond 1 53 2 25M 7908K sleep 2:46 0.31% otcmgr.tsk 17553 otc 1 53 2 17M 1208K sleep 0:46 0.18% icbc_pricing 16269 leafy 1 45 0 3360K 1688K sleep 0:00 0.13% bash 17202 mtrs 1 53 2 82M 19M sleep 1:08 0.12% dataserver.ts= k 17154 bond 1 53 2 82M 8004K sleep 0:35 0.12% dataserver.ts= k 13746 otc 1 53 2 30M 5136K sleep 0:37 0.11% dataserver.ts= k In our top, show threads does not tell you how many threads exactly exists in a process, is there any way to imitate the other top's behaviour? Jiawei --=20 "Without the userland, the kernel is useless." --inspired by The Tao of Programming