Re: PS output for threads

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 5/26/06, Abu M. Muttalib <abum@xxxxxxxxx> wrote:
Hi Tayseer,

Hi Abu
http://en.wikipedia.org/wiki/Top_posting

I don't agree with that. For any thread there will be a new task struct, and hence there will be new process ID and all.

This is true .. but this is now what i've said
for each new threads there will be a new task, new process id "pid", all threads have the same parent id "ppid" and the same process group id "pgid" and this is what is shown in your log
"Linux doesn't differentiate between processes and threads cause they all are tasks" i mean that both processes and threads will be presented by a task struct
CMIIW please
thanks

for example I have the following log:
 
  PID USER     STATUS   RSS  PPID %CPU %MEM COMMAND
  942 yoku     R        828   871  1.9  5.7 busybox
  834 yoku     S       2620     1  0.0 18.3 hopper
  891 yoku     S       2620   890  0.0 18.3 hopper
  890 yoku     S       2620   834  0.0 18.3 hopper
  871 yoku     S       1340     1  0.0  9.3 sh
  875 yoku     S       1336   874  0.0  9.3 Angelia
  872 yoku     S       1336     1  0.0  9.3 Angelia
  887 yoku     S       1336   874  0.0  9.3 Angelia
  888 yoku     S <     1336   874  0.0  9.3 Angelia
  876 yoku     S       1336   874  0.0  9.3 Angelia
  884 yoku     S       1336   874  0.0  9.3 Angelia
  885 yoku     S       1336   874  0.0  9.3 Angelia
  874 yoku     S       1336   872  0.0  9.3 Angelia
 
883 yoku     S       1336   874  0.0  9.3 Angelia
  886 yoku     S       1336   874  0.0  9.3 Angelia
  766 yoku     S       1092     1  0.0  7.6 SIMSCRIPT1
  767 yoku     S       1092     1  0.0  7.6 SIMSCRIPT2
  836 yoku     S        800     1  0.0  5.5 btsdpd
  811 yoku     S        712     1  0.0  4.9 btsrv
Regards,
Abu.

Abu M. Muttalib
Associate,
Aftek Infosys Ltd.,
Pune, India
Office: 91-20-25449260-65 X-254
Email: abum@xxxxxxxxx

-----Original Message-----
From: MHD.Tayseer Alquoatli [mailto:idoit.ief@xxxxxxxxx]
Sent: Friday, May 26, 2006 11:58 AM
To: Abu M. Muttalib
Cc: kernelnewbies@xxxxxxxxxxxx
Subject: Re: PS output for threads



On 5/25/06, Abu M. Muttalib <abum@xxxxxxxxx> wrote:
Hi,

I have an application wherein I have say 10 threads which are created
unconditionally and run a "while(1);".

Will they be shown in the output of ps -A as 10 different processes?

Hi
cause Linux don't differentiate between process and a threads .. they are all tasks
all your threads have the same parent process id "ppid" and share the same process group id "pgid"
hope this helps
 
--
MHD.Tayseer



--
MHD.Tayseer

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux