FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Document the public `multiprocessing.[Bounded]Semaphore.get_value` method and refactor code · Issue #133146 · python/cpython · GitHub

/ cpython Public

Document the public multiprocessing.[Bounded]Semaphore.get_value method and refactor code #133146

Description

Feature or enhancement

Proposal:

This improvement is based on @ronaldoussoren's comment at #125829 (comment)

  1. This public method should be documented in the synchronization primitives of multiprocessing module.
  2. I also suggest to refactor code with this public method, in replacement of calls to the private method semaphore._semlock._get_value in the following locations:

value = self._semlock._get_value()

value = self._semlock._get_value()

num_waiters = (self._sleeping_count._semlock._get_value() -
self._woken_count._semlock._get_value())

return self._maxsize - self._sem._semlock._get_value()

Has this already been discussed elsewhere?

This is a minor feature, which does not need previous discussion elsewhere

Links to previous discussion of this feature:

No response

Linked PRs

Metadata

Metadata

Assignees

Labels

stdlibStandard Library Python modules in the Lib/ directorytopic-multiprocessingtype-featureA feature request or enhancement

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


Back | FazBrowse Home | New Git URL