Skip to content
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

from multiprocessing.pool import Pool bug on linux #71092

Closed
859911096 mannequin opened this issue May 2, 2016 · 3 comments
Closed

from multiprocessing.pool import Pool bug on linux #71092

859911096 mannequin opened this issue May 2, 2016 · 3 comments
Labels
type-bug An unexpected behavior, bug, or error

Comments

@859911096
Copy link
Mannequin

859911096 mannequin commented May 2, 2016

BPO 26905
Nosy @MojoVampire
Files
  • pool.py: a Pool code
  • 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 = <Date 2016-05-03.06:26:21.158>
    created_at = <Date 2016-05-02.09:48:14.631>
    labels = ['type-bug', 'invalid']
    title = 'from multiprocessing.pool import Pool bug on linux'
    updated_at = <Date 2016-05-03.06:26:21.157>
    user = 'https://bugs.python.org/859911096'

    bugs.python.org fields:

    activity = <Date 2016-05-03.06:26:21.157>
    actor = 'SilentGhost'
    assignee = 'none'
    closed = True
    closed_date = <Date 2016-05-03.06:26:21.158>
    closer = 'SilentGhost'
    components = []
    creation = <Date 2016-05-02.09:48:14.631>
    creator = '859911096'
    dependencies = []
    files = ['42680']
    hgrepos = []
    issue_num = 26905
    keywords = []
    message_count = 3.0
    messages = ['264637', '264638', '264668']
    nosy_count = 3.0
    nosy_names = ['jnoller', 'sbt', 'josh.r']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue26905'
    versions = ['Python 2.7']

    @859911096
    Copy link
    Mannequin Author

    859911096 mannequin commented May 2, 2016

    When my code run on windows,it's right,but on linux,id(q) print same RAM address.

    @larryhastings
    Copy link
    Contributor

    This has nothing to do with Argument Clinic, which is an internal tool used in the Python 3.x series.

    @SilentGhost SilentGhost mannequin added the type-bug An unexpected behavior, bug, or error label May 2, 2016
    @MojoVampire
    Copy link
    Mannequin

    MojoVampire mannequin commented May 2, 2016

    The Queue module (queue on Py3) is for communication between threads, not processes; what you've written wouldn't behave correctly on any version of Python. You want to use multiprocessing's Queue class, not Queue.Queue, and to avoid possible deadlocks, you want to populate it after the pool workers are running.

    In any event, id(q) is expected to match on Linux, which has fork semantics (so the memory space in parent and child is initially identical). On Windows it differs because spawn based multiprocessing means the objects are recreated in the child processes, rather than inherited directly.

    This is a problem with your code and understanding on forking, not a problem in Python.

    @SilentGhost SilentGhost mannequin closed this as completed May 3, 2016
    @SilentGhost SilentGhost mannequin added the invalid label May 3, 2016
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant