Сегодня сессия вопросов и ответов приходит к нам с любезностью подразделения SuperUser под управлением Stack Exchange, основанной на сообществах групп вопросов и ответов.
Вопрос
Считыватель SuperUser Agovizer долго смотрел таблицу таблиц процессов в диспетчере задач Windows и возвращался с некоторыми вопросами, в частности:
What processes, if any, exist between PIDs 0 and 4 on Windows 7? Just out of curiosity what are the processes between 0 and 4, and also between 4 and 200 something.
Мы перешли в диспетчер задач на нашей машине, и, конечно же, в слотах 1, 2 и 3 не было процессов, в то время как наши PIDs прыгали с 4 до 340, в отличие от его 4-200.
Ответ
Участник SuperUser G Koe закрывает дело одним махом:
There is no Process ID 1, 2, or 3 because of how the NT kernel handle table works.
Handles are always multiples of four. The Kernel handle process object is used for both process handles and process/thread IDs. It happens that handle values all start at 0x4 (bit 2), and the InitialSystemProcess is the first process to be created, so it gets a PID of 4. Idle process isn’t actually a process and you can’t open it. It probably doesn’t have a real PID but most tools consider it to be 0.
More on the NT handle table here although this is only accurate for NT3-5(xp), as Windows 7 now requires that you only reference kernel handles if attached to PsInitialSystemProcess.
More on Windows 7/8 Handle limits from Mark Russinovich
More on the “multiples of four” in PIDs
Все, что он предлагает, проверяет: мы не имеем 1, 2 и 3 (не кратных 4), и каждое значение PID в нашем списке от 340 до 13136 делится на 4.
Есть что добавить к объяснению? Звучит в комментариях. Хотите узнать больше ответов от других пользователей Windows? Посмотрите здесь полную дискуссионную тему.