[issue7316] Add a timeout functionality to common locking operations

2010-04-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Thank you! Checked in in r80071. -- resolution: accepted - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org

[issue7316] Add a timeout functionality to common locking operations

2010-04-14 Thread Torsten Landschoff
Torsten Landschoff t.landsch...@gmx.net added the comment: While you are at it, you might want to submit the patch from http://bugs.python.org/issue850728 as well. It adds timeouts for semaphores. :) -- ___ Python tracker rep...@bugs.python.org

[issue7316] Add a timeout functionality to common locking operations

2010-04-13 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch against current py3k. About the timeout limit, an useful point of comparison is select(), which doesn't try to loop either: it just throws OverflowError if the specified timeout value is too large to be represented in a timeval

[issue7316] Add a timeout functionality to common locking operations

2010-04-13 Thread Jeffrey Yasskin
Jeffrey Yasskin jyass...@gmail.com added the comment: Thanks, looks good. Sorry for the delay. -- resolution: - accepted ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___

[issue7316] Add a timeout functionality to common locking operations

2010-03-20 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Here is a new patch fixing most of your comments. A couple of answers: I believe we can support arbitrary values here, subject to floating point rounding errors, by calling lock-with-timeout in a loop. I'm not sure whether that's a good idea,

[issue7316] Add a timeout functionality to common locking operations

2010-03-20 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15795/timedlock4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___

[issue7316] Add a timeout functionality to common locking operations

2010-02-01 Thread Brian Curtin
Changes by Brian Curtin cur...@acm.org: -- nosy: +brian.curtin ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___ ___ Python-bugs-list mailing

[issue7316] Add a timeout functionality to common locking operations

2010-01-08 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch against newest py3k. -- Added file: http://bugs.python.org/file15795/timedlock4.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316

[issue7316] Add a timeout functionality to common locking operations

2010-01-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15321/timedlock.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___

[issue7316] Add a timeout functionality to common locking operations

2010-01-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15352/timedlock2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___

[issue7316] Add a timeout functionality to common locking operations

2010-01-08 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: Removed file: http://bugs.python.org/file15533/timedlock3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___

[issue7316] Add a timeout functionality to common locking operations

2009-12-12 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Updated patch against py3k. -- keywords: +needs review Added file: http://bugs.python.org/file15533/timedlock3.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316

[issue7316] Add a timeout functionality to common locking operations

2009-12-09 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - pitrou stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___ ___

[issue7316] Add a timeout functionality to common locking operations

2009-12-05 Thread Andrew Svetlov
Changes by Andrew Svetlov andrew.svet...@gmail.com: -- nosy: +asvetlov ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___ ___ Python-bugs-list

[issue7316] Add a timeout functionality to common locking operations

2009-11-20 Thread Jesse Noller
Changes by Jesse Noller jnol...@gmail.com: -- nosy: +jnoller ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue7316 ___ ___ Python-bugs-list mailing

[issue7316] Add a timeout functionality to common locking operations

2009-11-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: This patch adds some docs and comments. It also adds the feature in the non-semaphore path of thread_pthread.h, which I had forgotten to address. -- Added file: http://bugs.python.org/file15352/timedlock2.patch

[issue7316] Add a timeout functionality to common locking operations

2009-11-17 Thread Jeffrey Yasskin
Jeffrey Yasskin jyass...@gmail.com added the comment: I don't object strongly, but since locks are supposed to be held for short amounts of time, a timeout shouldn't be that useful, and when people really need it they can put it together with a condition variable. Timeouts also interact

[issue7316] Add a timeout functionality to common locking operations

2009-11-17 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Timeouts also interact poorly with condition variables: you can time out the initial acquire, but if you wait on a condition there's no place to put the timeout on the reacquire. I don't see how it's an objection. If you have a condition

[issue7316] Add a timeout functionality to common locking operations

2009-11-17 Thread Jeffrey Yasskin
Jeffrey Yasskin jyass...@gmail.com added the comment: Timeouts also interact poorly with condition variables: you can time out the initial acquire, but if you wait on a condition there's no place to put the timeout on the reacquire. I don't see how it's an objection. If you have a condition

[issue7316] Add a timeout functionality to common locking operations

2009-11-13 Thread Antoine Pitrou
New submission from Antoine Pitrou pit...@free.fr: Here is a patch which adds a timeout feature to the locking operations provided by Python. This feature is added at two levels: - the C API level, with a new function PyThread_acquire_lock_timed() - the Python level, with an optional `timeout`