[issue34878] Lock Objects documentation bug

2018-10-04 Thread ulrich.stern


ulrich.stern  added the comment:

I still think the documentation should be changed, and an improved version 
would look more like your comment than what it looks now.  I assume to most 
people "owning" means exclusively holding the lock, and a particular thread can 
do this for Lock Objects.  For example, here what my #1 Google result for "lock 
ownership" 
(https://www.justsoftwaresolutions.co.uk/threading/locks-mutexes-semaphores.html)
 says:

> What it means to "own" a lock depends on the precise type of the lockable 
> object. For some lockable objects...  In other cases, the definition is more 
> fluid, and the ownership of the lock is more conceptual. In these cases, 
> ownership can be relinquished by a different thread or object than the thread 
> or object that acquired the lock.

In my opinion, the Python documentation currently takes the unusual point of 
view "a thread cannot 'own' a lock since it could be 'stolen' (released) by 
another thread."  And the Lock Objects documentation has no explanation for 
this view, which makes it possibly confusing.  Since multithreading is often 
tricky, documentation improvement seems worthwhile.  Happy to propose wording 
that incorporates our discussion if you are interested.

--

___
Python tracker 
<https://bugs.python.org/issue34878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34878] Lock Objects documentation bug

2018-10-02 Thread ulrich.stern


New submission from ulrich.stern :

The first sentence of the documentation for Lock Objects 
(https://docs.python.org/2/library/threading.html#lock-objects) seems 
incorrect.  It currently states "A primitive lock is a synchronization 
primitive that is not owned by a particular thread when locked."  The "not" 
should be deleted.  (Alternatively, one could change "locked" to "unlocked.")

--
assignee: docs@python
components: Documentation
messages: 326926
nosy: docs@python, ulrich.stern
priority: normal
severity: normal
status: open
title: Lock Objects documentation bug
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue34878>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com