Wednesday, September 20, 2006

ps on Linux displaying multiple instances of a process...
I was facing a question from a customer regarding ps showing multiple instances of the process which they mistook as to be multiple processes spawned over the 16 processors on the box by the primary process. I have posted a question on linuxquestions.org regarding this long time back but have not got any reply on this. Have a look at it here.



There were several things that I figured out on my own.


1. Linux treats threads as processes. There is no concept of thread in the Linux kernel.

2. ps command has a flag '-m' which shows threads spawned by the process. But ps on some kernel versions displays threads by default. When -m option is specified for ps on those kernel versions, ps gives out a message that 'thread display not implemented'.

Any more explanations are welcome.

No comments: