Днешната сесия за въпроси и отговори ни дойде с любезното съдействие на SuperUser - подразделение на Stack Exchange, обединено от общността на уеб сайтове за Q & A.
Въпроса
Дисплеят на SuperUser Agovizer отправи дълъг поглед върху таблицата за показване на таблиците Process in the Task Manager на 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.
Имате ли нещо, което да добавите към обяснението? Звучи в коментарите. Искате ли да прочетете повече отговори от други потребители на Stack Exchange? Вижте цялата тема на дискусията тук.