threads-shared - Re: pls a little help, kind of howto..

Posted on Wed Jun 20 19:01:37 2007 by calli in response to 5476 (See the whole thread of 4)
Re: pls a little help, kind of howto..
The problem occurs when a client drops its connection. Once the whole program stops absolutely nothing happend so it seems that both initial threads were blocked, another time only the first thread was blocked and the second thread one tries to make 'him' work again, but the second does not print out anything to the logfile ?? Could it be a problem that the Writer does this:
foreach my $f ( liesFiles($tmpMinDir) ) { next unless ( $f && (-s $f) ); print $SOC "# \tNow $thisPC will send you quotes of zip-file:$f, ".(-s $f)." bytes $EOL" +; open( SAVEOUT, ">&STDOUT" ) or warn "can't save stdout: $!\n"; open( STDOUT, ">&", $SOC ) or warn "can't dup to stdout: $!\n"; if ($f =~ /\.zip/) { system('nice','-1','unzip', '-p', $f ); } else { system('nice','-1','cat', $f); } open( STDOUT, ">&SAVEOUT" ) or warn "can't restore stdout: $!\n"; }
Do the threads have different STDIN and STDOUT? But the Writer is killed only after the cond_broadcast(@chat) of the Reader..? I derived my program, from a threaded-chat server, that I once programed and that you can
load from here: http://www.perlmonks.net/index.pl?node_id=473566. May be that even this wont work anymore propperly? Cheers,Carl
Direct Responses: 5490 | Write a response