in reply to Perl Threads

See Re: Perl Tk and Threads. For the problem of the thread starting with new(), you can control threads manually by putting them in a loop controlled by a go/stop shared variable, see Re: Perl/Tk threading and/or cron job? for example.

If you are using one of the latest versions of threads, you can also make use of Thread::Semaphore. Directly from "perldoc threads".

use threads; use Thread::Semaphore; sub thr_func { my $sema = shift; # Thread 'suspend/resume' signal handler $SIG{'STOP'} = sub { $sema->down(); # Thread suspended $sema->up(); # Thread resumes }; ... } # Create a semaphore and pass it to a thread my $sema = Thread::Semaphore->new(); my $thr = threads->create('thr_func', $sema); # Suspend the thread $sema->down(); $thr->kill('STOP'); ... # Allow the thread to continue $sema->up();

I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh