Skip to content

SharedMemory documentation: System V vs Posix #89891

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nescio007 mannequin opened this issue Nov 5, 2021 · 3 comments
Closed

SharedMemory documentation: System V vs Posix #89891

nescio007 mannequin opened this issue Nov 5, 2021 · 3 comments
Labels
3.11 only security fixes 3.12 only security fixes docs Documentation in the Doc dir topic-multiprocessing type-bug An unexpected behavior, bug, or error

Comments

@nescio007
Copy link
Mannequin

nescio007 mannequin commented Nov 5, 2021

BPO 45728
Nosy @terryjreedy, @pitrou, @applio, @nescio007

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2021-11-05.13:46:16.151>
labels = ['3.11', 'type-feature', '3.9', '3.10', 'docs']
title = 'SharedMemory documentation: System V vs Posix'
updated_at = <Date 2021-11-06.02:30:17.465>
user = 'https://github.com/nescio007'

bugs.python.org fields:

activity = <Date 2021-11-06.02:30:17.465>
actor = 'terry.reedy'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2021-11-05.13:46:16.151>
creator = 'jkrupp'
dependencies = []
files = []
hgrepos = []
issue_num = 45728
keywords = []
message_count = 2.0
messages = ['405797', '405843']
nosy_count = 5.0
nosy_names = ['terry.reedy', 'pitrou', 'docs@python', 'davin', 'jkrupp']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue45728'
versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

Linked PRs

@nescio007
Copy link
Mannequin Author

nescio007 mannequin commented Nov 5, 2021

Hi,

the documentation for the shared_memory module states that "shared memory refers to “System V style” shared memory". However, I believe it might be clearer to talk about "POSIX style shared memory" here instead.

Primed by the "System V style"-comment, I had expected that shared memory blocks could be identified through a numeric ID (as used by the system V shared memory APIs shmget, shmat, ...). After looking at the implementation it became clear though, that the newer POSIX-API (shm_open, shm_unlink, ...) is used, which explains why shared memory blocks have a name instead.

Technically, the documentation only uses "System V style" to distinguish it from "distributed shared memory", and further states that "[it] is not necessarily implemented explicitly as such". Yet, this distinction is particularly relevant if memory is to be shared with other (non-python!) processes (although placement of shared_memory in the multiprocessing package might indicate that that is not one of its expected use-cases...)

@nescio007 nescio007 mannequin added 3.8 (EOL) end of life 3.10 only security fixes 3.11 only security fixes 3.9 only security fixes labels Nov 5, 2021
@nescio007 nescio007 mannequin assigned docspython Nov 5, 2021
@nescio007 nescio007 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement 3.8 (EOL) end of life 3.10 only security fixes 3.11 only security fixes 3.9 only security fixes labels Nov 5, 2021
@nescio007 nescio007 mannequin assigned docspython Nov 5, 2021
@nescio007 nescio007 mannequin added docs Documentation in the Doc dir type-feature A feature request or enhancement labels Nov 5, 2021
@terryjreedy
Copy link
Member

'System V' is in the first line of the second paragraph of
https://docs.python.org/3/library/multiprocessing.shared_memory.html

Davin, git blame says you wrote this in Feb 2019.

@terryjreedy terryjreedy removed 3.8 (EOL) end of life labels Nov 6, 2021
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@torokati44
Copy link

This note in the docs also confused me (when trying to switch away from the posix_ipc package), and had to check the source that it is indeed "POSIX-style" instead.

See the answer by Terry Lambert here about the differences: https://www.quora.com/What-are-the-major-differences-between-System-V-and-POSIX-Shared-memory-implementations-available-on-Linux

I think that note should not reference "System V" as it is not correct, and only causes confusion.

@arhadthedev arhadthedev added type-bug An unexpected behavior, bug, or error 3.12 only security fixes and removed type-feature A feature request or enhancement 3.10 only security fixes 3.9 only security fixes labels May 20, 2023
serhiy-storchaka pushed a commit that referenced this issue Feb 1, 2024
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 1, 2024
…104678)

It only uses POSIX API.
(cherry picked from commit 500ede0)

Co-authored-by: Oleg Iarygin <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 1, 2024
…104678)

It only uses POSIX API.
(cherry picked from commit 500ede0)

Co-authored-by: Oleg Iarygin <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Feb 1, 2024
… (GH-114874)

It only uses POSIX API.
(cherry picked from commit 500ede0)

Co-authored-by: Oleg Iarygin <[email protected]>
serhiy-storchaka pushed a commit that referenced this issue Feb 1, 2024
… (GH-114873)

It only uses POSIX API.
(cherry picked from commit 500ede0)

Co-authored-by: Oleg Iarygin <[email protected]>
aisk pushed a commit to aisk/cpython that referenced this issue Feb 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.11 only security fixes 3.12 only security fixes docs Documentation in the Doc dir topic-multiprocessing type-bug An unexpected behavior, bug, or error
Projects
Development

No branches or pull requests

5 participants