[Ace-users] Multiple Processes in One Application

rabryn rabryn at gmail.com
Wed Feb 20 14:09:06 CST 2008


On Feb 20, 1:49 pm, schm... at dre.vanderbilt.edu (Douglas C. Schmidt)
wrote:
> Hi Rabryn,
>
> >I'm writing a multi-threaded application that uses ACE 5.5.10 as a
> >statically linked library in GNU/Linux 2.6.19.  If I start the
> >application and then execute a ps -e | grep 'appname' I see multiple
> >processes running.  My question is why are threads being shown as
> >processes?
>
> This is a Linux question, not an ACE question.  The reason you're
> seeing this is because Linux implements threads as (lightweight)
> processes.
>
> Doug
> --
> Dr. Douglas C. Schmidt                       Professor and Associate Chair
> Electrical Engineering and Computer Science  TEL: (615) 343-8197
> Vanderbilt University                        WEB:www.dre.vanderbilt.edu/~schmidt
> Nashville, TN 37203                          NET: d.schm... at vanderbilt.edu

Doug,

I'm executing my application (emman) on two different architectures.
The first being an x86 and the second is ARM9.  By executing a ps -eLf
| grep 'emman' on the x86 architecture I get the following...

developer at debian:~$ ps -eLf | grep 'emman'
1000     32084 26745 32084  0    3 23:32 pts/2    00:00:00 ./obj/emman
-c svc.conf
1000     32084 26745 32087  0    3 23:32 pts/2    00:00:00 ./obj/emman
-c svc.conf
1000     32084 26745 32088  0    3 23:32 pts/2    00:00:00 ./obj/emman
-c svc.conf
1000     32295 32098 32295  0    1 23:39 pts/4    00:00:00 grep emman
developer at debian:~$

I agree in this scenario you can see the process ID of the emman app
is 32084 and each thread has it's own LWP (32084, 32087, 32088).
However, when I execute the same application on the ARM9 architecture
I get the following...

root at sbc_23ba:~# ps -eLf | grep 'emman'
root      1750  1690  1750 15    1 14:03 pts/0    00:00:00 /root/emman
-c /root/svc.conf
root      1751  1750  1751  0    1 14:03 pts/0    00:00:00 /root/emman
-c /root/svc.conf
root      1754  1751  1754  0    1 14:03 pts/0    00:00:00 /root/emman
-c /root/svc.conf
root      1755  1751  1755  0    1 14:03 pts/0    00:00:00 /root/emman
-c /root/svc.conf
root      1757  1715  1757  0    1 14:03 pts/2    00:00:00 grep emman
root at sbc_23ba:~#

Ignoring the fact that there is an extra entry (I can't explain that
either!) you can see there are distinct process IDs for each thread
with a matching LWP ID.  Both architectures are using ACE 5.5.10 and
were compiled with the same configuration.  I understand this may be a
Linux question, or even an ARM9 gcc question, but any ideas you may
have would be greatly appreciated.

Thanks,
rabryn


More information about the Ace-users mailing list