From: Jarkko Hietaniemi <jhi@iki.fi> Date: Sun, 12 May 2002 01:38:15 +0000 (+0000) Subject: Detypos (and sticking with US spelling since Dan Sugalski X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f3278b06ba5642b0217ce1d2ec161817bd5c7100;p=p5sagit%2Fp5-mst-13.2.git Detypos (and sticking with US spelling since Dan Sugalski wrote the original text of perlthrtut) p4raw-id: //depot/perl@16552 --- diff --git a/ext/threads/threads.pm b/ext/threads/threads.pm index 4aba309..b4ee6d0 100755 --- a/ext/threads/threads.pm +++ b/ext/threads/threads.pm @@ -161,7 +161,7 @@ to get current thread id if you don't have your thread handy. =item threads->yield(); This will tell the OS to let this thread yield CPU time to other threads. -However this is highly depending on the underlying thread implmentation. +However this is highly depending on the underlying thread implementation. =item threads->list(); diff --git a/pod/perlthrtut.pod b/pod/perlthrtut.pod index 2fb09c9..455be15 100644 --- a/pod/perlthrtut.pod +++ b/pod/perlthrtut.pod @@ -433,7 +433,7 @@ In the case of a shared array, all the array's elements are shared, and for a shared hash, all the keys and values are shared. This places restrictions on what may be assigned to shared array and hash elements: only simple values or references to shared variables are allowed - this is -so that a private variable can't accidently become shared. A bad +so that a private variable can't accidentally become shared. A bad assignment will cause the thread to die. For example: use threads; @@ -508,13 +508,13 @@ by other threads, you must take steps to coordinate access or risk data inconsistency and race conditions. Note that Perl will protect its internals from your race conditions, but it won't protect you from you. -=head1 Synchonisation and control +=head1 Synchronization and control Perl provides a number of mechanisms to coordinate the interactions between themselves and their data, to avoid race conditions and the like. Some of these are designed to resemble the common techniques used in thread libraries such as C<pthreads>; others are Perl-specific. Often, the -standard techniques are clumsly and difficult to get right (such as +standard techniques are clumsily and difficult to get right (such as condition waits). Where possible, it is usually easier to use Perlish techniques such as queues, which remove some of the hard work involved. @@ -525,7 +525,7 @@ No other thread may lock the variable until the the variable is unlocked by the thread holding the lock. Unlocking happens automatically when the locking thread exists the outermost block that contains C<lock()> function. Using lock() is straightforward: this example has -several threads doing some calculations in parallel, and occasionaly +several threads doing some calculations in parallel, and occasionally updating a running total: use threads; @@ -540,7 +540,7 @@ updating a running total: { lock($total); # block until we obtain the lock $total += $result - } # lock implicity released at end of scope + } # lock implicitly released at end of scope last if $result == 0; } } @@ -609,7 +609,7 @@ traditional thread libraries. Locks are a handy tool to synchronize access to data, and using them properly is the key to safe shared data. Unfortunately, locks aren't -without their dangers, espacially when multiple locks are involved. +without their dangers, especially when multiple locks are involved. Consider the following code: use threads; @@ -652,7 +652,7 @@ order. If, for example, you lock variables $a, $b, and $c, always lock $a before $b, and $b before $c. It's also best to hold on to locks for as short a period of time to minimize the risks of deadlock. -The other syncronisation primitives described below can suffer from +The other syncronization primitives described below can suffer from similar problems. =head2 Queues: Passing Data Around