On 03/13/2016 02:14 PM, Peter Scott wrote:
> On Sat, 12 Mar 2016 18:44:18 +0200, Lars Noodén wrote:
[snip]
>> What modification can prevent zombies yet allow multiple concurrent
>> clients to attach?
>
> You need the WNOHANG option on your wait() to make it nonblocking.
Thanks. I've been explori
On Sat, 12 Mar 2016 18:44:18 +0200, Lars Noodén wrote:
> The snippet below works to fork as a specific user, if run as root.
> However, it generates zombies. The functions wait() or waitpid() seem
> to be available to use to stop that, but if I insert either of them in
> the outer while loop, only
Thanks, David and Shlomi (and those that read),
I understand fork() and the style of writing better. Strange that the
defaults for 'use English' are not optimal.
The snippet below works to fork as a specific user, if run as root.
However, it generates zombies. The functions wait() or waitpid()
Hi Lars,
some comments on your code:
On Fri, 11 Mar 2016 20:22:34 +0200
Lars Noodén wrote:
> If I have the code below to fork a child process, how would the right
> way be to fork as a different user? I gather that fork() itself does
> not support that, so some other method must be used.
>
>
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hello all.
AFAIK, you can't do that. When you fork everything is copied, including
the UID.
To achieve something similar, you need to launch another process (but
you'll need to be root to launch it as another user)
Regards,
David Santiago
On F
If I have the code below to fork a child process, how would the right
way be to fork as a different user? I gather that fork() itself does
not support that, so some other method must be used.
Regards,
Lars
-
#!/usr/bin/perl
use strict;
use warnings;
use English;# for $UID and such
my
On 08/10/12 02:10, G M wrote:
I'm working on a forking process and I need a way to check if any of the
processes have failed and if they have restart them. Can anyone point me in
the right direction to a tutorial or explanation of how to do this?
"Network Programming with Perl&quo
>
> Hi,
>
> I'm working on a forking process and I need a way to check if any of the
> processes have failed and if they have restart them. Can anyone point me
> in the right direction to a tutorial or explanation of how to do this?
>
Or use a server framework like POE
Hi Graeme,
On Fri, 10 Aug 2012 10:10:10 +0100
G M wrote:
>
> Hi,
>
> I'm working on a forking process and I need a way to check if any of
> the processes have failed and if they have restart them. Can anyone
> point me in the right direction to a tutorial or explanat
Hi,
I'm working on a forking process and I need a way to check if any of the
processes have failed and if they have restart them. Can anyone point me in
the right direction to a tutorial or explanation of how to do this?
Thanks in advance,
Graeme
And the book "Network programming with Perl" is a good book for Perl
client/server development including the fork stuff.
> -Original Message-
> From: dery...@gmail.com
> Sent: Wed, 15 Jun 2011 13:11:38 -0700 (PDT)
> To: beginners@perl.org
> Subject: Re: perl
On Jun 15, 11:21 am, noah-l...@enabled.com (Noah) wrote:
> Hi there,
>
> can somebody recommend a good tutorial web link and/or URL for learning
> perl forking please?
>
Presumably, you've already seen these docs:
perldoc perlipc
perldoc perlfork # fork emulation f
Hi there,
can somebody recommend a good tutorial web link and/or URL for learning
perl forking please?
Cheerss
Noah
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
>>>>> ""XUFENG"" == "XUFENG" writes:
"XUFENG"> Hi,
"XUFENG"> I plan to implement a threading or forking http server to
receive client request,after handling the requested url,it gives out new urls.
"XUFENG
2009/7/6 XUFENG :
> Hi,
> I plan to implement a threading or forking http server to receive
> client request,after handling the requested url,it gives out new urls.
> What is the better module to use?
A perl module or httpd module?
for perl module, could use CGI.pm
Hi,
I plan to implement a threading or forking http server to receive
client request,after handling the requested url,it gives out new urls.
What is the better module to use?
Thank you for any suggestions.
--
XUFENG
2009-07-06
--
To
Anirban Adhikary wrote:
Hi List
Hello,
I am trying to write a code which will work as self monitoring script. The
parent will work for something and child will check that parent program is
running or not .
You want to do that the other way around. The child will do the work
and the paren
Hi List
I am trying to write a code which will work as self monitoring script. The
parent will work for something and child will check that parent program is
running or not . If parent is not running or somehow killed or crashed then
child will restart the parent . But I am not getting the desire
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>In his case there is not a portability issue. What is not portable is
>using the parent's handle inside the child, but he is opening a new
>handle inside the child. The problem was the auto-close behavior
>which is made a non-probl
On 5/9/07, Tom Allison <[EMAIL PROTECTED]> wrote:
snip
In short -- you are lucky it can be supported.
But in order to keep things portable, this might be something to avoid?
In his case there is not a portability issue. What is not portable is
using the parent's handle inside the child, but he
On May 9, 2007, at 5:41 PM, Jeff Pang wrote:
-Original Message-
From: Chas Owens <[EMAIL PROTECTED]>
The solution:
Setting a flag (InactiveDestroy) on the parent's handle inside the
child process prevents the automagic closing of the connection.
* the magic in this case is the DES
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>$dbh->{InactiveDestroy} = 1;
>$dbh = DBI->connect($dsn, $dbun, $dbpw,
>{RaiseError => 1});
># do stuff
yes this is the same with my meanings.Child re-open an
On 5/9/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
snip
Using InactiveDestroy flag seems a standard way since this module's author
provide this flag.
But it's maybe bring some problems when the applications are large enough,and
it's not
the fact that every programmer would disconnect their dbh con
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>
>The solution:
>
>Setting a flag (InactiveDestroy) on the parent's handle inside the
>child process prevents the automagic closing of the connection.
>
>* the magic in this case is the DESTROY method of DBI::db
Using InactiveDest
On 5/9/07, Tom Allison <[EMAIL PROTECTED]> wrote:
> sing its handle unexpectedly.
>
> The solution:
>
> Setting a flag (InactiveDestroy) on the parent's handle inside the
> child process prevents the automagic closing of the connection.
>
> * the magic in this case is the DESTROY method of DBI::d
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>
>And happily such a flag exists: InactiveDestroy.
>
>Just add
>
>$dbh->{InactiveDestroy} = 1;
>
>to the child and the problem should go away.
>
I'm also happy to know it,this is good.
--
mailto:[EMAIL PROTECTED]
http://home.arco
sing its handle unexpectedly.
The solution:
Setting a flag (InactiveDestroy) on the parent's handle inside the
child process prevents the automagic closing of the connection.
* the magic in this case is the DESTROY method of DBI::db
Where do you get the inactiveDestroy?
Is this something miss
On 5/9/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
This is an interesting point, but I think a database might be more
similar to a network socket than a file handle.
I have this same observed behaviour under Oracle and PostgreSQL, so it's
not limited to mysql (and shouldn't be fixed with my
"Jeff Pang" <[EMAIL PROTECTED]> wrote:
>
>
>-Original Message-
>>From: Chas Owens <[EMAIL PROTECTED]>
>>Sent: May 10, 2007 12:02 AM
>>To: Jeff Pang <[EMAIL PROTECTED]>
>>Cc: beginners-list
>>Subject: Re: forking
create the database connection after you fork().
On 5/9/2007, "Chas Owens" <[EMAIL PROTECTED]> wrote:
>On 5/9/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
>snip
>> This is the reason really.I was also confused for this case once.
>> Thanks for Chas's explain.
>snip
>
>Knowing what is happe
<[EMAIL PROTECTED]> wrote:
>I'm am having an issue with a mysql connection that displays itself when
>there's forking going on which I can't track down.
>
>I've made a test program at http://jeremy.kister.net/code/ftest.pl to
>demonstrate. I ex
On 5/9/07, Chas Owens <[EMAIL PROTECTED]> wrote:
On 5/9/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
snip
> Yes but I think is this maybe a bug in DBI class?For example,open a file
handle and
> after forking child close that handle,this would not affect parent's handle.
snip
On 5/9/07, Jeremy Kister <[EMAIL PROTECTED]> wrote:
On 5/9/2007 11:12 AM, Chas Owens wrote:
> my $dbh = DBI->connect($dsn, $dbun, $dbpw, {RaiseError => 1});
>
> to
>
> my $dbh = DBI->connect(
> $dsn, $dbun, $dbpw,
> {
> RaiseError => 1,
> mysql_auto_reconnect => 1
> }
-Original Message-
>From: Jeremy Kister <[EMAIL PROTECTED]>
>Sent: May 10, 2007 12:17 AM
>To: beginners@perl.org
>Subject: Re: forking problem with dbd::mysql
>
>On 5/9/2007 11:12 AM, Chas Owens wrote:
>> my $dbh = DBI->connect($dsn, $dbun, $dbpw, {Raise
On 5/9/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
snip
Yes but I think is this maybe a bug in DBI class?For example,open a file handle
and
after forking child close that handle,this would not affect parent's handle.
snip
It definitely violates the principle of least surprise, but i
On 5/9/2007 11:12 AM, Chas Owens wrote:
> my $dbh = DBI->connect($dsn, $dbun, $dbpw, {RaiseError => 1});
>
> to
>
> my $dbh = DBI->connect(
> $dsn, $dbun, $dbpw,
> {
> RaiseError => 1,
> mysql_auto_reconnect => 1
> }
> );
Yes, that works, just as a regular my $dbh = D
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>Sent: May 10, 2007 12:02 AM
>To: Jeff Pang <[EMAIL PROTECTED]>
>Cc: beginners-list
>Subject: Re: forking problem with dbd::mysql
>
>On 5/9/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
>snip
{};
$dbh->disconnect();
}
}
Ok where in child when going out of scope the $dbh should get disconnected.
But why this would affect the $dbh in parent?As we know,when forking child get a
full copy of $dbh from parent and it's separate to parent's $dbh.
snip
But the connection in
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>Sent: May 9, 2007 11:25 PM
>To: Jeremy Kister <[EMAIL PROTECTED]>
>Cc: beginners@perl.org
>Subject: Re: forking problem with dbd::mysql
>
>On 5/9/07, Chas Owens <[EMAIL PROTECTED]> wrote:
>
On 5/9/07, Jeff Pang <[EMAIL PROTECTED]> wrote:
snip
This is the reason really.I was also confused for this case once.
Thanks for Chas's explain.
snip
Knowing what is happening is only half the battle, now we need to find
a non-hacky solution.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For a
-Original Message-
>From: Chas Owens <[EMAIL PROTECTED]>
>> It looks like it has something to do with $dbh going out of scope
>> (when the child exits).
>snip
>
>This is definitely a case of the database handle auto-disconnecting
>when it is destroyed. You can see the behavior by creati
On 5/9/07, Chas Owens <[EMAIL PROTECTED]> wrote:
snip
It looks like it has something to do with $dbh going out of scope
(when the child exits).
snip
This is definitely a case of the database handle auto-disconnecting
when it is destroyed. You can see the behavior by creating a set of
DBI subcl
On 5/9/07, Jeremy Kister <[EMAIL PROTECTED]> wrote:
On 5/9/2007 12:01 AM, Jeff Pang wrote:
> 1) too less timeout setting in my.cnf? see /etc/my.cnf and look for this line:
I actually have no my.cnf. But if I s/my $pid = fork()/my $pid=1/ all
works fine, even with 60 second sleeps.
> 2) as we k
On 5/8/2007 6:46 PM, Jeremy Kister wrote:
> I'm utilizing fork for the first time, and am having an issue which I
> can't track down.
I sent this original email with a bad return address. Four and a half
hours later, when the post still didnt make it to the list, I realized
that the I had used
I'm utilizing fork for the first time, and am having an issue which I
can't track down.
I've made a test program at http://jeremy.kister.net/code/ftest.pl to
demonstrate. I expect this program to print 'SQL RESULT: 1' for as long
as it can.
SQL RESULT: 1
SQL RESULT: 1
SQL RESULT: 1
DBD::mys
On 5/9/2007 12:01 AM, Jeff Pang wrote:
> 1) too less timeout setting in my.cnf? see /etc/my.cnf and look for this line:
I actually have no my.cnf. But if I s/my $pid = fork()/my $pid=1/ all
works fine, even with 60 second sleeps.
> 2) as we know,child exiting would return a SIGCHLD signal to par
-Original Message-
>From: Jeremy Kister <[EMAIL PROTECTED]>
>Sent: May 9, 2007 11:05 AM
>To: beginners@perl.org
>Subject: forking problem with dbd::mysql
>
>I'm am having an issue with a mysql connection that displays itself when
>there's fork
I'm am having an issue with a mysql connection that displays itself when
there's forking going on which I can't track down.
I've made a test program at http://jeremy.kister.net/code/ftest.pl to
demonstrate. I expect this program to print 'SQL RESULT: 1' for as long
>Thanks Jay and Tom! I added this little bit to my script:
>
>select (CHILD);
>$| = 1;
>select (STDOUT);
>
>and it worked just as I expected it to. It's interesting, though,
>that I've been working with sockets a bunch through IO::Socket and my
>print statements seem to print to the socket strea
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote:
Thanks Jay and Tom! I added this little bit to my script:
select (CHILD);
$| = 1;
select (STDOUT);
and it worked just as I expected it to. It's interesting, though,
that I've been working with sockets a bunch through IO::Socket and my
print
On 11/8/06, Jay Savage <[EMAIL PROTECTED]> wrote:
There are a couple of things going on here.
First, the issue of what prints when is driven by buffering. Since you
haven't turned on autofulsh on any of your file handles, the buffer is
flushed whenever it's convenient for the the system. The res
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote:
print CHILD "printing to child\n";
sleep 5;
Concurrent processes can be counterintuitive at times. Because the
CHILD filehandle is buffered, that line won't necessarily be sent to
the child process right away. In your program, I'd expe
On 11/8/06, Jen Spinney <[EMAIL PROTECTED]> wrote:
use strict;
use warnings;
print "First Trial:\n\n";
if (open(CHILD, "|-"))
{
print "parent starts: ", (scalar localtime),"\n";
sleep 5;
print "parent ends: ", (scalar localtime),"\n";
}
else
{
print "child starts: ", (scalar l
On 11/8/06, John W. Krahn <[EMAIL PROTECTED]> wrote:
Jen Spinney wrote:
> Hello all!
Hello,
> print "\nSecond Trial:\n\n";
>
> if (open(CHILD, "|-"))
> {
>print "parent starts: ", (scalar localtime),"\n";
>print CHILD "printing to child\n";
>sleep 5;
>print "parent ends: ", (sca
Jen Spinney wrote:
> Hello all!
Hello,
> print "\nSecond Trial:\n\n";
>
> if (open(CHILD, "|-"))
> {
>print "parent starts: ", (scalar localtime),"\n";
>print CHILD "printing to child\n";
>sleep 5;
>print "parent ends: ", (scalar localtime),"\n";
> }
> else
> {
>my $time = sc
Hello all!
I've come to a point where I really need to start understanding
forking, threaded, select, and all that stuff. I created a test
script to play around with and it's doing what I'd expect, except for
one bit. My test script:
use strict;
use warnings;
print "Fi
Paul Johnson wrote:
On Mon, May 15, 2006 at 04:46:07PM -0400, Tom Allison wrote:
I've got a *bunch* of code that I've been rewriting recently and ran
into a rather weird problem.
it won't fork.
If I write the following:
foreach my $file ( @$files ) {
my $pid = fork();
print "$pid --> $fil
gt; []
>}
>
>I will get an output of:
>0 --> file_one
>3242 --> file_one
>0--> file_two
>
>but no 3243-->file_two.
>
>Repeated print statements later on in the job continue to indicate that
>this is not forking correctly.
>
Try this:
use strict;
m
On 5/15/06, Tom Allison <[EMAIL PROTECTED]> wrote:
my $pid = fork();
print "$pid --> $file\n";
Because your process table can become full and temporarily prevent
forking new processes, you should check the return value of fork
whenever you're making more than N p
On Mon, May 15, 2006 at 04:46:07PM -0400, Tom Allison wrote:
> I've got a *bunch* of code that I've been rewriting recently and ran
> into a rather weird problem.
>
> it won't fork.
>
> If I write the following:
>
> foreach my $file ( @$files ) {
> my $pid = fork();
> print "$pid --> $file\
t; file_one
3242 --> file_one
0--> file_two
but no 3243-->file_two.
Repeated print statements later on in the job continue to indicate that
this is not forking correctly.
I've been changing a number of things over to objects and references,
but I can't see anyway that
>> The process's pid is 1 really.It has been take-overed by system init
>> process.
>>
Sorry for my mistake,it should be "the process's ppid" really.ppid just mean
'parent process id'.
--
Jeff Pang
NetEase AntiSpam Team
http://corp.netease.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For
Thanks Jeff,
That clarifies it.
Regards
Cornelis
--memento mori
On 3/14/06, Jeff Pang <[EMAIL PROTECTED]> wrote:
>
>
> >
> >Does that not mean that a parent will stay alive until all children have
> >finished ?
> >
>
> No,the parent should get exited when it finish its session,in spite of
> chi
>
>Does that not mean that a parent will stay alive until all children have
>finished ?
>
No,the parent should get exited when it finish its session,in spite of childs
are still running or not.
When the parent exit,the childs should be take-overed by system init
process,whose process ID is typi
Thanks a lot for your replies, I've incorporated the children counter
variable, increasing it after every fork, decreasing it after every
SIG{CHLD}.
However, I still have an unresolved issue,
Jay:
> It's not missing; it was never there. Your parent process dies before
> its children are finished
It's not so easy to do that.
you should use the signal to communicate between childs and parent.
-Original Message-
>From: Saurabh Singhvi <[EMAIL PROTECTED]>
>Sent: Mar 14, 2006 3:57 AM
>To: Perl FAq
>Subject: forking doubt
>
>Hi all,
>
>
> my
On Tue, Mar 14, 2006 at 08:57:03AM +, Saurabh Singhvi wrote:
>my $child = fork ();
>
>unless ($child) {
>sleep 5;
>print "child\n";
>}
>
>print "parent\n" if $child;
>print "parent2\n" if $child;
>
>
> the above code prints the parent lines followed by t
Hi all,
my $child = fork ();
unless ($child) {
sleep 5;
print "child\n";
}
print "parent\n" if $child;
print "parent2\n" if $child;
the above code prints the parent lines followed by the child. Now what i
want to do is print the parent
line1 and then the child fol
>This would be a bad idea since the process never exits.
En? I just want to show the childs exiting status.
Surely,you could modify it simply to get main process exit normally.
for example:
# you could get the childs numbers by counting the @files array
$CHILD_COUNT=N;
# defined the sig handle
Jeff Pang wrote:
You can't see the output in your log is because when your childs are
executing,your parent has exited.
In order to see the callbacking childs,just add this line in the code end:
sleep while(1); # parent sleep to wait for childs exiting
This would be a bad idea since the proc
>
>The SIG{CHLD} handler doesn't get called since the output from
>
>> print LOG "Child process no. $stiff exited with status $?\n";
>>
>is missing.
>
You can't see the output in your log is because when your childs are
executing,your parent has exited.
In order to see the callbacking childs,jus
t;-out", "$episode");
die "Can't execute tovid for process no $$ on file $file: $!";
}
else
{
print LOG "Forked child process no. $pid for file $file.\n";
}
$SIG{CH
On 3/13/06, Cornelis Swanepoel <[EMAIL PROTECTED]> wrote:
>
> I have found the following text in the perlfork manpage:
>
> Calling exec() within a pseudo-process actually spawns the requested
> > executable in a separate process and waits for it to complete before exiting
> > with the same exit st
Cornelis Swanepoel wrote:
The SIG{CHLD} handler doesn't get called since the output from
print LOG "Child process no. $stiff exited with status $?\n";
is missing.
It's not missing; it was never there. Your parent process dies before
its children are finished. It is no longer around to reap
sode");
die "Can't execute tovid for process no $$ on file $file:
$!";
}
else
{
print LOG "Forked child process no. $pid for file $file.\n";
}
$SIG{CHLD} = \&REAPER;
}
Tovi
steve abrams wrote:
> * code 'paraphrased' for simplicity *
>
> Hi all,
>
> I have a script which goes to a subroutine. Within the
> subroutine, there exists:
>
> $pid = fork;
> push(@pids, $pid);
> unless ($pid)
> {
>my $var = new Object;
>if (not $var->method_that_evokes_a_
* code 'paraphrased' for simplicity *
Hi all,
I have a script which goes to a subroutine. Within the subroutine, there
exists:
$pid = fork;
push(@pids, $pid);
unless ($pid)
{
my $var = new Object;
if (not $var->method_that_evokes_a_child()) {Exit;}
exit 2;
}
where the Ex
rows the
whole cleanup mechanism of DBI in the bucket. Suppose I made a typo that
will cause the whole thing to die at runtime. Depending on the database
engine I could get an undesired commit of the last transaction if the socket
just closes. The natural thing to do for me was to preceed the ca
> I need some assistance.
>
> I wrote a script that takes an array of IP addresses, and in a foreach
> loop uses a subroutine to make a few SNMP connections, and writes
> results to a flat file.(snipet below)
>
> For 1000 IP addresses, it takes 17 minutes. I wonder if there's a way
> to fork 10-
I need some assistance.
I wrote a script that takes an array of IP addresses, and in a foreach
loop uses a subroutine to make a few SNMP connections, and writes
results to a flat file.(snipet below)
For 1000 IP addresses, it takes 17 minutes. I wonder if there's a way
to fork 10-20 (at a time) (
ne without POE. In
<http://www.stonehenge.com/merlyn/PerlJournal/col09.html>, I tail a
logfile (I do that a lot :) and deliver it to an IRC channel,
throttled appropriately so that I don't get booted off for channel
flooding.
POE is like forking, without the complete separation of d
At 11:32 AM 3/9/04 -0700, Wiggins d Anconia wrote:
> ... "famboozled watchamathingie with xanatically whooziewhatsit" on a
beginners list ;-)...
Oh yeah, since you bring it up about the whooziewhatsit ...
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
> At 09:52 AM 3/9/04 -0700, Wiggins d Anconia wrote:
> > ...
> >a framework for handling time slicing, or event
> >programming tasks, or multi-tasking processes
>
> If that's what it is, these terms localize it pretty well for me. "An
> event-based framework for handling time-slicing in multitaski
At 09:52 AM 3/9/04 -0700, Wiggins d Anconia wrote:
> ...
>a framework for handling time slicing, or event
>programming tasks, or multi-tasking processes
If that's what it is, these terms localize it pretty well for me. "An
event-based framework for handling time-slicing in multitasking processes."
> At 08:54 AM 3/9/04 -0700, Wiggins d Anconia wrote:
> >In this case the desire to fork multiple processes and maintain
> >bi-directional communication with them becomes a nightmare of dealing
> >with forking code, pipes, and all of the other IPC nasties.
> >POE::Whe
At 08:54 AM 3/9/04 -0700, Wiggins d Anconia wrote:
>In this case the desire to fork multiple processes and maintain
>bi-directional communication with them becomes a nightmare of dealing
>with forking code, pipes, and all of the other IPC nasties.
>POE::Wheel::Run encapsulates
to
things that "Perl makes easy".
In this case the desire to fork multiple processes and maintain
bi-directional communication with them becomes a nightmare of dealing
with forking code, pipes, and all of the other IPC nasties.
POE::Wheel::Run encapsulates all of that providing a ver
At 11:08 PM 3/8/04 -0500, Wiggins d'Anconia wrote:
>This is where I do my usual little dance, though untimely as it may be
>in this case, across the stage and say "POE" then exit again as if I was
>still on vacation
OK, I'll bite. What's so great about POE, and why, oh, why, do you love it
Bob Showalter wrote:
Price, Jason wrote:
Hmm...I guess that's the majority of the script. :) I can follow
what it does, but I'm not entirely sure why it does it.
Also, is there any way I can self-contain the output from each child
process?
You can use a separate pipe for each child, but now y
ldren
> > have already exited (otherwise the loop wouldn't have exited.) You
> > might want the exit statuses or not. You can also usually use
> > $SIG{CHLD} = 'IGNORE' prior to the forking loop if you don't care
> > about exit statuses. see "perldoc perlip
27;t have exited.) You might want
> the exit statuses or not. You can also usually use $SIG{CHLD} = 'IGNORE'
> prior to the forking loop if you don't care about exit statuses. see
> "perldoc perlipc"
Uh, I appologize - anyway, could you explain that last part to me?
Do
hile wait() > 0"
That just reaps the exit statuses to prevent zombies; the children have
already exited (otherwise the loop wouldn't have exited.) You might want the
exit statuses or not. You can also usually use $SIG{CHLD} = 'IGNORE' prior
to the forking loop if you don'
p with and less complicated then having
seperate handles for each child :-)
Id be interested in how you solf that.
HTH, Wolf
> Thanks.
>
> Jason
>
> -Original Message-
> From: Bob Showalter [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 1:17 PM
> To:
Message-
From: Bob Showalter [mailto:[EMAIL PROTECTED]
Sent: Wednesday, March 03, 2004 1:17 PM
To: 'Price, Jason'; '[EMAIL PROTECTED]'
Subject: RE: Forking
Price, Jason wrote:
> Not sure if this is the right list for this - if it's not, please
> direct me to the p
Price, Jason wrote:
> Not sure if this is the right list for this - if it's not, please
> direct me to the proper list.
You've come to the right place.
>
> Anyway, I'm trying to get my hands around forking, and was hoping you
> all could help me out. Basically, I&
Not sure if this is the right list for this - if it's not, please direct me
to the proper list.
Anyway, I'm trying to get my hands around forking, and was hoping you all
could help me out. Basically, I'm trying to find a way to fire off a remote
script on numerous boxes in para
On Dec 10, 2003, at 4:52 PM, Dan Anderson wrote:
I am learning about forks, so I tried the following code to make sure I
had everything down:
#! /usr/bin/perl
use strict;
use warnings;
my $counter = 1;
my $pid = 0;
while ($counter < 50) {
if ($pid = fork) {
open ("FORKED", ">./fork/$counter
d = fork) {
> open ("FORKED", ">./fork/$counter")
> or die("COULD NOT OPEN FORK");
> print FORKED $counter;
> close("FORKED");
> $SIG{CHLD} = "IGNORE";
> }
> $counter++;
> }
>
[snip]
> So what a
h Perl, eh? Did I
> mention that it covers forking well?
LOL. Thanks for all your help. I actually put a copy on my Safari
bookshelf but I have yet to start it.
-Dan
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl
On Dec 10, 2003, at 3:52 PM, Dan Anderson wrote:
I am learning about forks, so I tried the following code to make sure I
had everything down:
Still don't believe me about Network Programming with Perl, eh? Did I
mention that it covers forking well?
Basic idea of fork:
if ($pid =
1 - 100 of 138 matches
Mail list logo