I'm trying to understand the top program better, and I don't really get the 'z' option which highlights all running processes.

Wouldn't all processes in top be considered running? In what context would a process be listed in top but not considered running?

有帮助吗?

解决方案

Question is off-topic and should be elsewhere. But then again, maybe this helps to formulate better question in Unix & Linux or Super User.

Assume that you have a computer which has only one central processing unit with only single core. This kind of a computer can not execute programs in parallel, because only one task (that can be a program running in the user space or a kernel task, e.g.) can access the CPU at any one time.

Multitasking operating system kernels, like Linux, let each task access the CPU in turns for a little while, thus making it seem that they are running in parallel. In reality tasks are run in a sequential style and only one task is in running state in our fictional toy compyter with just one CPU containing a single core. Other tasks spend most of their time in other states, mostly in TASK_INTERRUPTIBLE but they can also be stopped (with Ctlr-z for example) and so on and so forth.

Things aren't as simple as I've described above in modern computers having multiple CPUs with multiple cores, but the idea still applies: only programs actually running on a core will be in running state, other tasks are in other states which are mostly aggregated to be in sleeping state by top (displayed as 'S').

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top