LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Is there a PID 0? (https://www.linuxquestions.org/questions/linux-newbie-8/is-there-a-pid-0-a-878839/)

Galbatross 05-04-2011 03:16 PM

Is there a PID 0?
 
Hello,

I'm currently doing some debugging and I'm attempting to find out which task is running between two events. I'm using a bus analyzer to trigger after I configure my hardware and stopping it once an overflow event takes place. During this period, I write the PID of the current task running every millisecond by checking the variable 'currnet->pid'. It seems that the task's PID right before my overflow event is 0. A quick 'ps' reveals that there is not a task 0.

I'm curious if anyone would know off-hand what a PID 0 represents? If I had to guess, I would say it's an interrupt handler, but I can't be positive. Any feedback is very appreciated!

Thanks,
Galbatross.

MensaWater 05-04-2011 03:30 PM

The lowest PID in UNIX/Linux is PID 1 which is init. All processes are children of init in the process table heirarchy.

My guess is that you're not seeing PID 0 but rather are getting a non-existent value being interpreted as "0" before you have a PID number assigned.

syg00 05-04-2011 06:12 PM

Nope. This comes up continually.
Have a read of this for example.

Galbatross 05-05-2011 07:49 AM

Thanks
 
Very helpful, thank you.

Galbatross

brownie_cookie 05-05-2011 08:02 AM

if you're pleased with the answer, please mark this thread as solved !

Have a nice day and enjoy LQ

:hattip:


All times are GMT -5. The time now is 02:17 AM.