repost: too many processes for an impl

Steffen Hansen stefh@mip.ou.dk
Thu, 5 Mar 1998 08:45:48 +0100 (MET)


On Wed, 4 Mar 1998, Rahul Sood wrote:

> I compiled omniOrb 2.4.0 on a Linux kernel 2.0.29 on i586. omniThread
> uses Posix threads on Linux. I checked and confirmed that I have
> /usr/include/pthread.h and /usr/lib/libpthread.a
> 
> When running the examples I noticed that upto 5 processes are created for
> every impl object. Shouldn't impl objects be created in their own threads
> instead of their own processes? omniNames also creates 5 processes on my
> machine. Here's the output from ps, which shows 5 processes for the
> omniOrb example eg3_impl, and 5 for omniNames. eg3_impl causes a 6th
> process to be created for omniNames. At this rate I will run out of
> process id's if running a few dozen objects under the BOA!

The thread library you use uses kernel threads, which in
Linux is implemented via the clone() system call (a generalized fork()).
In the Linux kernel there is no differense between threads and processes
and ps will show all threads as seperate processes. But dont worry, they
are "real" threads living in the same adress-space.

I think when clone() is fully done in Linux (maybe in v.2.2), the
threads within a process will share the same pid, so that
"duplicates" can be filtered out. But for now each thread has its
own pid and looks like a process.

greetings,
--------------
Steffen Hansen                            
email: stefh@mip.ou.dk, stefh@imada.ou.dk 
URL:   http://www.mip.ou.dk/~stefh