I want to have a model where the boss sends the worker off to do some work. 
The worker does not need to communicate the results back to the boss. 
Meanwhile, the boss needs to report that the worker is working at regular 
intervals until the worker is done.

    my $thread = threads->create(\&workerThread);
    my $tid = $thread->tid;
    $thread->detach();
    
    while(1) {
        print "worker thread $tid is busy\n";
        sleep 3;
        last unless threads->object($tid);
    }

The problem that I'm having is that the while loop never terminates. I 
thought that once the worker was done, the call to threads->object($tid) 
would return undef.

How can the boss monitor the worker?

Thanks for any help.
Tom




Reply via email to