##
if ( $count>$maxthreads ){
####
use threads;
use threads::shared;
our $S ||= 1;
my $t:shared = 0;
$|++;
while( 1 ){
printf"\r$m\t%d\t", do{ lock $t; $t };
if( do{ lock $t; $t } < 10 ) {
$m++;
threads->create(
sub{
{ lock $t; $t++ }
select undef, undef, undef, $S;
{ lock $t; $t-- }
}
)->detach;
}
else{
select undef, undef, undef, 0.01;
}
}