From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([69.77.167.62] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1KM2SY-0006fg-0l for garchives@archives.gentoo.org; Thu, 24 Jul 2008 15:10:26 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id EFB84E0321; Thu, 24 Jul 2008 15:10:23 +0000 (UTC) Received: from py-out-1112.google.com (py-out-1112.google.com [64.233.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id D71F0E0321 for ; Thu, 24 Jul 2008 15:10:23 +0000 (UTC) Received: by py-out-1112.google.com with SMTP id w53so1620441pyg.25 for ; Thu, 24 Jul 2008 08:10:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:subject:date :user-agent:references:in-reply-to:mime-version:content-type :content-transfer-encoding:content-disposition:message-id; bh=iDaOMofD5/Yckvc01OcK2ok4cv+q62EYZ0o8W+7ef+U=; b=iI0ct+TRTAWwWsP35sZXzQCyPf7ek+Egnj19xjfmw6ufH7/ek0krTETu5wIdqKHwLI 0X+SFo7dqB9VRDSTd+UZmtT9G+qXnC4mobs6qwIFtIaXepgHzBEf805Dbv7m5PVtE1ch i93O1MqsdwSRZHCpSbaEkkAwfqOHGqGeRXy0g= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:subject:date:user-agent:references:in-reply-to:mime-version :content-type:content-transfer-encoding:content-disposition :message-id; b=pRdr5zKoCiGfuDL4sckDXBQXCtIMNPPLcTj8RHLnKPyJQtCgdQj39NlScDl+3f0+Sm wXzZI3DkqXYJ51dQ33gkxBBiUMI+GfXP18fLk4b/eCVIVsrt/DdqnlzEySTqEZ1lnNG7 2xU340lP/ApkrLxzuPe5kn7221HN8vRbSwYQM= Received: by 10.64.48.8 with SMTP id v8mr680086qbv.92.1216912223296; Thu, 24 Jul 2008 08:10:23 -0700 (PDT) Received: from ?10.0.0.3? ( [41.243.208.33]) by mx.google.com with ESMTPS id 25sm12116968qbw.1.2008.07.24.08.10.21 (version=SSLv3 cipher=RC4-MD5); Thu, 24 Jul 2008 08:10:22 -0700 (PDT) From: Alan McKinnon To: gentoo-user@lists.gentoo.org Subject: Re: [gentoo-user] ps command Date: Thu, 24 Jul 2008 17:09:43 +0200 User-Agent: KMail/1.9.9 References: <6b16fb4c0807230109m3082f32p140648211f7cdae9@mail.gmail.com> <48885C6D.3020103@gmail.com> In-Reply-To: <48885C6D.3020103@gmail.com> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-user@lists.gentoo.org Reply-to: gentoo-user@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200807241709.44433.alan.mckinnon@gmail.com> X-Archives-Salt: dc78175f-6639-493f-9954-a0055225e03a X-Archives-Hash: 69e1f402ee4556c00bdada8c51f52429 On Thursday 24 July 2008, b.n. wrote: > > I jump here to relief my everlasting UNIX ignorance. > > What does it mean a process is "sleeping", technically? It's a misnomer, it means "not running". The cpu gives the illusion of executing many tasks simultaneously. In reality, it is executing them one at a time and very rapidly (many times a second) switching between them. Normally at a given instant in time, one task is running per cpu. The rest are mostly waiting their turn or sleeping. There are various OS strategies for bringing this about - some rely on the task itself to back out after a running for a short while, sometimes the OS kernel enforces it, sometimes you have a combination. If everything is working nicely, the end result is pretty much the same. There's another state worthy of note - blocked. This is when a task is waiting for something else to happen first (most often disk or network I/O) so it won't try and execute till that other thing happens. This is not the same as sleeping. Sleeping is spinning you wheels in idle, blocked is a deliberate stop and sit back and wait. hth alan -- Alan McKinnon alan dot mckinnon at gmail dot com