btoovey has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use threads; # threading routines use threads::shared; use Thread::Queue; our $queue : shared = Thread::Queue->new; for (1..30){ $thr = threads->new(\&thread_sub); } for (1..30) { $thr1 = threads->new(\$thread_sub1); } $thr->join; $thr1->join; sub thread_sub { while ($test == 0) { if (certain test is true) {$test = 1;} } #### Now here is where I am getting really god damned lost {my $action = $queue->enqueue;} } sub thread_sub1 { $action = $queue->dequeue; #??? totally lost here print "I am going to do your bidding master now that the test is + true\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multi-threaded questions
by zentara (Cardinal) on Dec 08, 2006 at 14:07 UTC | |
by btoovey (Novice) on Dec 08, 2006 at 14:09 UTC | |
|
Re: multi-threaded questions
by renodino (Curate) on Dec 08, 2006 at 16:26 UTC | |
by btoovey (Novice) on Dec 08, 2006 at 16:32 UTC | |
by btoovey (Novice) on Dec 08, 2006 at 19:15 UTC | |
by renodino (Curate) on Dec 08, 2006 at 20:30 UTC | |
by btoovey (Novice) on Dec 08, 2006 at 21:16 UTC | |
by renodino (Curate) on Dec 08, 2006 at 22:08 UTC | |
|
Re: multi-threaded questions
by Anonymous Monk on Dec 09, 2006 at 01:00 UTC | |
by zentara (Cardinal) on Dec 09, 2006 at 12:31 UTC | |
by renodino (Curate) on Dec 09, 2006 at 21:20 UTC |