Sponsored Content
Top Forums Shell Programming and Scripting 36 Child Processes not running as desired Post 302405045 by nthiruvenkatam on Thursday 18th of March 2010 12:23:37 AM
Old 03-18-2010
36 Child Processes not running as desired

I have a parent process which will start 36 child process. This I achieved by using the 'for loop'.

In Parent.sh:-
./Child.sh <arg1> <arg2> ... &

If I execute "ps -ef | grep Child.sh", I can see 72 child processes running at the background. I mean I can see the duplicate of each process.

Few Outputs:-
root 21239 15095 0 09:40:09 pts/1 0:00 /bin/bash ./Child.sh /TS_Files/abcdCCR1/ abcdccr1 abcdCCR1
root 15095 1 0 09:38:51 pts/1 0:00 /bin/bash ./Child.sh /TS_Files/abcdCCR1/ abcdccr1 abcdCCR1

Moreover the child processes are not working as desired. That is, Child process receives the arguments which sends from Parent. But the child process not at all using this arguments for its processing.

If I invoke only two child processes, I can see the desired results. In two child process scenario, if I execute the ps -ef command as mentioned above, there are no duplicate process created. Only when I invoke more child processes, I have the problem as mentioned above.

I am suspecting, Does the duplicate process creates any problem in my case?

Can anyone help me on this regard?

Thanks
Thiru
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

what are parent and child processes all about?

I don't follow what these are... this is what my text says... "When a process is started, a duplicate of that process is created. This new process is called the child and the process that created it is called the parent. The child process then replaces the copy for the code the parent... (1 Reply)
Discussion started by: xyyz
1 Replies

2. Programming

Controlling child processes

Hello all, I am trying to create n child processes and control them from a parent process; say make child 3 print its pid and then child 5 do the same and some other stuff. Is there a way to accomplishing this after all the child processes are created via a call to fork(). Thank you, FG (23 Replies)
Discussion started by: forumGuy
23 Replies

3. Shell Programming and Scripting

Parent/Child Processes

Hello. I have a global function name func1() that I am sourcing in from script A. I call the function from script B. Is there a way to find out which script called func1() dynamically so that the func1() can report it in the event there are errors? Thanks (2 Replies)
Discussion started by: yoi2hot4ya
2 Replies

4. Programming

fork() and child processes

Hello, How many child processes are actually created when running this code ? #include <signal.h> #include <stdio.h> int main () { int i ; setpgrp () ; for (i = 0; i < 10; i++) { if (fork () == 0) { if ( i & 1 ) setpgrp () ; printf ("Child id: %2d, group: %2d\n", getpid(),... (0 Replies)
Discussion started by: green_dot
0 Replies

5. Shell Programming and Scripting

fork() and child processes

Hello, How many child processes are actually created when running this code ? #include <signal.h> #include <stdio.h> int main () { int i ; setpgrp () ; for (i = 0; i < 10; i++) { if (fork () == 0) { if ( i & 1 ) setpgrp () ; printf ("Child id: %2d, group: %2d\n",... (1 Reply)
Discussion started by: green_dot
1 Replies

6. UNIX for Advanced & Expert Users

killing all child processes

Hi, Is there a way I can kill all the child processes of a process, given its process id. Many thanks in advance. J. (1 Reply)
Discussion started by: superuser84
1 Replies

7. Programming

How to limit the number of child processes

I need a mechanism to fork child processes and all child processes should connect to a server.but the number of child processes should be limited(for ex:50) Here's my pseudo, but I cant figure out how to limit the child process number. Should I use a semaphore? or what? for(;;)... (3 Replies)
Discussion started by: xyzt
3 Replies

8. Shell Programming and Scripting

A script that kills previous instances of itself upon running not killing child processes

I'm likely going to explain this clumsily, so apologies in advance: I have the following script: #!/bin/bash pidPrefix="logGen" checkPrime () { if /sbin/ifconfig eth0:0|/bin/grep -wq inet;then isPrime=1;else isPrime=0;fi } killScript () { /usr/bin/find /var/run -name... (4 Replies)
Discussion started by: DeCoTwc
4 Replies

9. Shell Programming and Scripting

Controlling the Number of Child processes

I am trying to implement the below using Ksh script on a Lx machine. There is a file(input_file) with 100K records. For each of these records, certain script(process_rec) needs to be called with the record as input. Sequential processing is time-consuming and parallel processing would eat up... (2 Replies)
Discussion started by: APT_3009
2 Replies

10. Shell Programming and Scripting

Get all child processes of a process

is there a universal way of getting the children of a particular process? i'm looking for a solution that works across different OSes...linux, aix, sunos, hpux. i did a search online and i kept finding answers that were specific to Linux..i.e. pstree. i want to be able to specify a process... (2 Replies)
Discussion started by: SkySmart
2 Replies
Child::Link::IPC(3pm)					User Contributed Perl Documentation				     Child::Link::IPC(3pm)

NAME
Child::Link::IPC - Base class for process links that provide IPC. SEE ALSO
This class inherits from: Child::Link METHODS
$proc->new( $pid. @shared ) Constructor $proc->read() Read a message from the child. $proc->write( @MESSAGES ) Send the messages to the child. works like print, you must add " ". $proc->say( @MESSAGES ) Send the messages to the child. works like say, adds the seperator for you (usually " "). $proc->autoflush( $BOOL ) Turn autoflush on/off for the current processes write handle. This is on by default. $proc->flush() Flush the current processes write handle. $proc->ipc() $proc->_ipc( $new ) Accessors for you to use or ignore. ABSTRACT METHODS
$proc->read_handle() Should return a read handle for reading from the child. $proc->write_handle() Should return a write handle for writing to the child. $proc->init( @shared ) Called by new during construction HISTORY
Most of this was part of Parrallel::Runner intended for use in the Fennec project. Fennec is being broken into multiple parts, this is one such part. FENNEC PROJECT
This module is part of the Fennec project. See Fennec for more details. Fennec is a project to develop an extendable and powerful testing framework. Together the tools that make up the Fennec framework provide a potent testing environment. The tools provided by Fennec are also useful on their own. Sometimes a tool created for Fennec is useful outside the greator framework. Such tools are turned into their own projects. This is one such project. Fennec - The core framework The primary Fennec project that ties them all together. AUTHORS
Chad Granum exodist7@gmail.com COPYRIGHT
Copyright (C) 2010 Chad Granum Child is free software; Standard perl licence. Child is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. perl v5.10.1 2011-03-07 Child::Link::IPC(3pm)
All times are GMT -4. The time now is 06:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy