O'Reilly logo

Web Performance Tuning, 2nd Edition by Patrick Killelea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Processes and the Kernel

Unix work is divided up into processes, which you can think of as tasks to be done. Each process has a unique process ID, which is simply an integer and an owner, along with priority and many other attributes that you can see with the ps command.

Unix is multiuser and multitasking, so many processes belonging to many users can be running concurrently. (NT, on the other hand, is multitasking, but not multiuser.) Of course, Unix processes are not all running at exactly the same time; it looks that way because the operating system is letting each process run for a bit of time, then interrupting it and letting the next one run, more or less in round-robin fashion. The process that does the scheduling runs in the kernel and is known as the scheduler. Processes are scheduled in terms of “clock ticks,” which are hundredths of a second, so every process is allocated at least one one-hundredth of a second when it starts its turn. The scheduler itself typically takes much less than that, around one millisecond. This is known as scheduling latency. Scheduling latency increases as the number of tasks to be run increases.

The kernel is some address space and tasks that do scheduling and other fundamental functions, such as directly interfacing to the hardware to display something on-screen or to write something to disk. Only the kernel has direct access to the hardware, and the kernel is accessible to user programs only through the system calls that define ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required