lwknet has asked for the wisdom of the Perl Monks concerning the following question:
========================================== output of ps -aux ============================================ root 12882 1.0 0.0 11752 3504 pts/0 S 21:07 0:00 /usr/bin/perl /root/threads.pl root 12885 0.0 0.0 11752 3504 pts/0 S 21:07 0:00 /usr/bin/perl /root/threads.pl root 12886 0.0 0.0 11752 3504 pts/0 S 21:07 0:00 /usr/bin/perl /root/threads.pl root 12887 0.0 0.0 11752 3504 pts/0 S 21:07 0:00 /usr/bin/perl /root/threads.pl root 12888 0.0 0.0 11752 3504 pts/0 S 21:07 0:00 /usr/bin/perl /root/threads.pl r =============================================#!/usr/bin/perl use Config; $Config{useithreads} || die "Recompile Perl with threads to run this p +rogram."; use threads; #use threads::shared; #use Thread::Running; #use Thread::Signal; #use Thread::Queue; sub ithread { my $i; my $arg=shift||''; print "just received - $arg\n"; foreach(1...20) { print $i++, "\n"; sleep(1); } } foreach(1...3) { my $thread = threads->create( "ithread", "arg" ); } foreach(1...30) { sleep(1); print "running..\n"; } exit;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: (supposingly) threads now being fork()'ed...
by polettix (Vicar) on Jul 21, 2005 at 07:59 UTC | |
|
Re: (supposingly) threads now being fork()'ed...
by GrandFather (Saint) on Jul 21, 2005 at 05:43 UTC |