How many child processes can parent has?

How many child processes can parent has?

Post by Jaguk K » Sat, 20 Jan 2001 16:16:39



Hi, all

I have one process which forks many child processes.
how many child processes can parent process fork?
if there is a maximun which is less than what i expect, i'd better have
several same parent processes.
is that right?

and, one more question.
which one is more effective?
1. only one process doing a job.
2, several processes doing a job concurrently.

 
 
 

How many child processes can parent has?

Post by Rainer Temm » Sat, 20 Jan 2001 17:37:38



> I have one process which forks many child processes.
> how many child processes can parent process fork?
> if there is a maximun which is less than what i expect, i'd better have
> several same parent processes.
> is that right?

> and, one more question.
> which one is more effective?
> 1. only one process doing a job.
> 2, several processes doing a job concurrently.

Hi Jaguk Ku,

there is usually a limit of "maximum processes per user" which can be
configured in
the Unix-kernel. This limit applies when forking children from one or from
more than one parents. (The only user without such a limit is root. The only
limit applying to root is "maximum processes in the system".)

Efficiency (Questions 1 and 2) is hard to tell, without knowing what you
want to do.
- Scenario-A) A process allocates large amounts of heap-memory...
   Such a process will run more efficiently if it serves more than one
   clients. Because multiple instances of such a process might require
   heavy swapping activities.

- Scenario-B) A process with small or medium requirements of heap-memory,
   but a number of blocking sequence points (such as database-transactions)
   or blocking calls to some library functions...
   Such a process might run better, if started unique for each client.

Regards Rainer

 
 
 

How many child processes can parent has?

Post by Lew Pitche » Sun, 21 Jan 2001 11:44:32



> Hi, all

> I have one process which forks many child processes.
> how many child processes can parent process fork?

In theory, all of them. <g> (Think of init (pid 1) and how every other
process is somehow a decendant of init).

In practice, it's limited by various means, including quotas/ulimits, OS
implementation (max processes in process table), and OS design
(hardcoded fork() throttling logic).  There will also be exceptions and
escapehatches to these limits.

Quote:> if there is a maximun which is less than what i expect, i'd better have
> several same parent processes.

Which, of course, are children of another process <g>

Quote:> is that right?

It may be so.

Quote:> and, one more question.
> which one is more effective?
> 1. only one process doing a job.
> 2, several processes doing a job concurrently.

It depends on the job to be done. If the job is atomic (can't be
subdivided) then a single process will likely be more effective than
multiple processes because you'll avoid artifically imposed deadlocks
and race conditions. If the job can be subdivided effectively, then
several processes _may_ be more effective (assuming that there are
little or no external costs, like reduced processing intervals because
of the increased number of processes)

--
Lew Pitcher

Master Codewright and JOAT-in-training
Registered Linux User #112576

 
 
 

1. Can a child process change the parent process's directory?

A child process can not change the current directory of the parent because
the two processes have their own local environments.

The only exception is when you source one script from another. The sourced
script can change the current directory of the its parent. This is only
possible in scripts not C programs.

2. AIX Books

3. child process of parent process group

4. Single User Mode

5. Parent process also terminating after killing child process in SIGINT

6. NTP client for linux?

7. programming an ethernet portably

8. How does a parent process know his child process dead?

9. how does a parent process know his child process dead?

10. How can kill all child processes without killing parent process ?

11. detatch a child process from its parent process

12. Child process terminates when parent process killed