Bug 1117950 - [RFE] Condition object must provide the n argument for notifying more than one waiter
Summary: [RFE] Condition object must provide the n argument for notifying more than on...
Alias: None
Product: ovirt-distribution
Classification: oVirt
Component: python-pthreading
Version: python-pthreading-0.1.3
Hardware: Unspecified
OS: Unspecified
medium vote
Target Milestone: ---
: ---
Assignee: Yaniv Bronhaim
QA Contact: Pavel Stehlik
Depends On:
TreeView+ depends on / blocked
Reported: 2014-07-09 17:06 UTC by Nir Soffer
Modified: 2019-04-28 13:41 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Enhancement
Doc Text:
Clone Of:
Last Closed: 2017-11-27 10:36:26 UTC
oVirt Team: Infra
oourfali: ovirt-future?
sherold: Triaged+
rule-engine: planning_ack?
oourfali: devel_ack?
rule-engine: testing_ack?

Attachments (Terms of Use)

Description Nir Soffer 2014-07-09 17:06:59 UTC
Description of problem:

pthreading.Condition.notify does not provide the n argument that was added in Python 2.7. This make prevent using this class as a drop in replacement fro the builtin threading.Condition class.

Version-Release number of selected component (if applicable):

This is the required interface:

    def notify(n=1):

When calling with n>1, this should wake up n waiters, but the Python
documentation warn that " it’s not safe to rely on this behavior. A future, optimized implementation may occasionally wake up more than n threads."
So we may choose to implement it ny invoking notify_all().

See https://docs.python.org/2/library/threading.html#threading.Condition.notify

Comment 1 Saggi Mizrahi 2014-07-13 08:09:43 UTC
We could just do a for loop calling notify() though I don't understand why make this part of the interface. Could easily be done by the caller. Classic python stdlib over-design

Comment 3 Red Hat Bugzilla Rules Engine 2015-11-30 22:37:27 UTC
Bug tickets must have version flags set prior to targeting them to a release. Please ask maintainer to set the correct version flags and only then set the target milestone.

Comment 4 Yaniv Kaul 2017-11-19 12:53:18 UTC
Yaniv, is anyone working on it - or are we going to?

Comment 5 Yaniv Bronhaim 2017-11-19 12:58:18 UTC
with vdsm current use cases in pthreading I don't see any need to align the interface and publish new version of pthreading for ovirt
Nir, please tell your opinion and change status if needed.

Comment 6 Nir Soffer 2017-11-19 17:03:48 UTC
I agree with Yaniv, we just need to document this difference, in case someone try
to use pthreading in another context.

Note You need to log in before you can comment on or make changes to this bug.