develooper Front page | perl.perl5.porters | Postings from October 1999

Re: perlthread.pod -- First draft of thread docs

From:
Dan Sugalski
Date:
October 24, 1999 07:16
Subject:
Re: perlthread.pod -- First draft of thread docs
Message ID:
3.0.6.32.19991024101934.00c57d80@tuatha.sidhe.org
At 04:44 PM 8/9/99 +0300, Tuomas J. Lukka wrote:
>Maybe really emphasize the fact that unlike in other languages, you should
>get the lock EVEN IF MANY THREADS ONLY READ THE VARIABLE AND NO-ONE WRITES.

But it's actually safe for lots of threads to read the variable
simultaneously. It's just tough to tell whether an access is a read or
update...

You're right, though. More emphasis is necessary, and a more complete
explanation's probably warranted in the FAQ or something

>Also, I really think that only allowing locks like this is troublesome:
>we should also allow C<unlock>

Just out of curiosity, why? I presume it's unlock in addition to locks
getting released when they fall out of scope. I can see the occasional
need, but I don't know that it'd be used enough to justify the extra
hassles involved.

					Dan

----------------------------------------"it's like this"-------------------
Dan Sugalski                            even samurai
dan@sidhe.org                           have teddy bears and even
                                        teddy bears get drunk



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About