Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-82300: Add track parameter to shared memory#110778

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpshead merged 28 commits intopython:mainfrompan324:shmemuntrack
Dec 5, 2023
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
Show all changes
28 commits
Select commitHold shift + click to select a range
3be08b4
add track parameter to shared memory
pan324Oct 12, 2023
f50812a
phrasing
pan324Oct 12, 2023
cbc8431
📜🤖 Added by blurb_it.
blurb-it[bot]Oct 12, 2023
7138447
phrasing
pan324Oct 12, 2023
6bbfca6
Merge branch 'main' of https://github.com/python/cpython into shmemun…
pan324Oct 12, 2023
db79426
Merge branch 'python:main' into shmemuntrack
pan324Oct 12, 2023
db11894
Merge branch 'shmemuntrack' of github.com:pan324/cpython into shmemun…
pan324Oct 12, 2023
d44cb82
Delete Doc/library/result.html
pan324Oct 12, 2023
c62cff0
Merge branch 'main' into shmemuntrack
ambvOct 13, 2023
dcda10f
Update Misc/NEWS.d/next/Library/2023-10-12-18-19-47.gh-issue-82300.P8…
pan324Oct 15, 2023
63d21d7
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 15, 2023
e990e41
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 15, 2023
9c593ba
Removed TypeError. Clarified documentation.
pan324Oct 17, 2023
9ef1ff3
untracking shmem can unlink now
pan324Oct 17, 2023
e5fe674
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 19, 2023
66acf90
removed unneeded try-except
pan324Oct 19, 2023
3fdf625
phrasing of track parameter
pan324Oct 19, 2023
d65e3f8
Update Doc/library/multiprocessing.shared_memory.rst
pan324Oct 24, 2023
a97c6d3
untracking test
pan324Oct 24, 2023
17c07f5
untrack tests both track=True and track=False
pan324Oct 25, 2023
13f3fb6
untrack tests both track=True and track=False
pan324Oct 25, 2023
7c7f0e7
untrack tests both track=True and track=False
pan324Oct 25, 2023
765afb7
reliable test cleanup
pan324Nov 30, 2023
a5848c1
Update Doc/library/multiprocessing.shared_memory.rst
pan324Dec 1, 2023
8255e01
split tests
pan324Dec 1, 2023
5d89117
split tests
pan324Dec 1, 2023
66db5b8
style: add a missing blank line
gpsheadDec 2, 2023
52053f8
Merge branch 'main' into shmemuntrack
gpsheadDec 2, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
phrasing
  • Loading branch information
@pan324
pan324 committedOct 12, 2023
commit7138447cd669529391d58114b66579d65bd8b44a
36 changes: 17 additions & 19 deletionsDoc/library/multiprocessing.shared_memory.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -65,35 +65,33 @@ copying of data.
to an existing shared memory block, the ``size`` parameter is ignored.

*track*, when enabled, registers the shared memory block with the resource
tracker process. This process ensures proper cleanup of shared memory
tracker process.This process ensures proper cleanup of shared memory
blocks even when all other processes with access to the memory have failed
to do so (mainly due to being killed by signals). The resource tracker is
to do so (mainly due to being killed by signals).The resource tracker is
overzealous in certain situations and might delete a shared memory block
when any process with access to the shared memory has terminated. *track*
when any process with access to the shared memory has terminated.*track*
should be set to ``False`` if there is already another process in place
that does the bookkeeping. In most situations, this means that *track*
that does the bookkeeping.In most situations, this means that *track*
should be set to ``False`` when *create* is set to ``False``.

.. method:: close()

Closesaccessto the shared memory from this instance. In order to
ensure proper cleanup of resources, all instances with *track* set to
``True`` should call ``close()`` once the instance is no longer needed.
Note that calling ``close()`` doesnotcause the shared memory block
itself to be destroyed.
Closesthe file descriptor/handleto the shared memory from this
instance. All instances should call ``close()`` once the instance
is no longer needed. Depending on operating system, the underlying
memory may or maynotbe freed even if all handles to it have been
closed. To ensure proper cleanup, use the ``unlink()`` method.

.. method:: unlink()

Requests that the underlying shared memory block be destroyed. In
order to ensure proper cleanup of resources, ``unlink()`` should be
called once (and only once) across all processes which have need
for the shared memory block. After requesting its destruction, a
shared memory block may or may not be immediately destroyed and
this behavior may differ across platforms. Attempts to access data
inside the shared memory block after ``unlink()`` has been called may
result in memory access errors. Note: the last process relinquishing
its hold on a shared memory block may call ``unlink()`` and
:meth:`close()` in either order.
Deletes the underlying shared memory block. This should be called only
once per shared memory block regardless of the number of handles to it.
After requesting its deletion, a shared memory block may or may not be
immediately destroyed and this behavior may differ across platforms.
Attempts to access data inside the shared memory block after
``unlink()`` has been called may result in memory access errors.
To ensure proper bookkeeping, ``unlink()`` may only be called by
an instance with *track* enabled.

.. attribute:: buf

Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp