[pydotorg-www] Fwd: A little mistake, Agustin
Michael Foord
mfoord at python.org
Sat Dec 18 03:26:54 CET 2010
A reader has reported an error (and I'm pretty sure he's correct - see
below) in the article at:
http://www.python.org/doc/essays/threads.html
This article isn't in the website svn and so I can't just correct it. I
assume it is an old-and-no-longer-maintained article. The article itself
starts with "This is an unfinished draft!".
I think the best course of action is just to delete it from the website.
Anyone disagree?
All the best,
Michael
-------- Original Message --------
Subject: A little mistake, Agustin
Date: Fri, 17 Dec 2010 19:00:59 -0500
From: salmeron at london.com
To: webmaster at python.org
Hello guys,
I am computer engineer with big experience developing in C/C++.
First of all thanks for your work, I think it is a great contribution.
I was reading this page http://www.python.org/doc/essays/threads.html
And in my opinion the following paragraph contain a tiny mistake.
The words underlain are in reverse order, so will be [.... from locked
to unlocked ..... ]
...
A lock is an object with two states: locked and unlocked. Initially, it
is in the unlocked state. It has two methods: acquire() and release().
The acquire() method changes the lock from the unlocked into the locked
state. This is like setting a semaphore to unsafe and entering the
stretch of railroad tracks guarded by the semaphore. The release()
method changes the lock from _unlocked to locked_; it is like leaving
the stretch and resetting the semaphore to safe. When acquire() is
called on a lock that is already locked, the operation *blocks* until
another thread invokes the release() method. This is like a train
waiting to enter the stretch until the semaphore signals safe. It is
illegal to call release() when the lock is unlocked. This would be like
a train leaving the guarded stretch without having set the semaphore to
unsafe on entering -- a crash may occur!
...
Thanks a lot.
I have some time, so I would like to collaborate with the project in any
way.
Agustin Fuentes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pydotorg-www/attachments/20101218/8e1a1b84/attachment.html>
More information about the pydotorg-www
mailing list