summaryrefslogtreecommitdiff
path: root/pod/perlthrtut.pod
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-05-29 01:16:23 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-05-29 01:16:23 +0000
commit818c4caa84c1eb56340765ecb8e5b3df206aeab1 (patch)
treef47399cf80a385fc6ad627beb9a11c0ebf3c1763 /pod/perlthrtut.pod
parent23be5fc44878216e0d4fdb73cb32d7e0832e94bc (diff)
downloadperl-818c4caa84c1eb56340765ecb8e5b3df206aeab1.tar.gz
pod cleanups.
p4raw-id: //depot/perl@16849
Diffstat (limited to 'pod/perlthrtut.pod')
-rw-r--r--pod/perlthrtut.pod6
1 files changed, 3 insertions, 3 deletions
diff --git a/pod/perlthrtut.pod b/pod/perlthrtut.pod
index b1f29c8d2f..6fda10f1f8 100644
--- a/pod/perlthrtut.pod
+++ b/pod/perlthrtut.pod
@@ -331,7 +331,7 @@ Perl's threading package provides the yield() function that does
this. yield() is pretty straightforward, and works like this:
use threads;
-
+
sub loop {
my $thread = shift;
my $foo = 50;
@@ -344,7 +344,7 @@ this. yield() is pretty straightforward, and works like this:
my $thread1 = threads->new(\&loop, 'first');
my $thread2 = threads->new(\&loop, 'second');
my $thread3 = threads->new(\&loop, 'third');
-
+
It is important to remember that yield() is only a hint to give up the CPU,
it depends on your hardware, OS and threading libraries what actually happens.
Therefore it is important to note that one should not build the scheduling of
@@ -433,7 +433,7 @@ L<threads::shared> module and the C< : shared> attribute:
my $foo : shared = 1;
my $bar = 1;
threads->new(sub { $foo++; $bar++ })->join;
-
+
print "$foo\n"; #prints 2 since $foo is shared
print "$bar\n"; #prints 1 since $bar is not shared