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

multiprocessing.Pool() problem in windows #51371

Closed
SirLalala mannequin opened this issue Oct 14, 2009 · 2 comments
Closed

multiprocessing.Pool() problem in windows #51371

SirLalala mannequin opened this issue Oct 14, 2009 · 2 comments
Labels
stdlib Python modules in the Lib dir

Comments

@SirLalala
Copy link
Mannequin

SirLalala mannequin commented Oct 14, 2009

BPO 7122
Nosy @amauryfa
Files
  • prueba.py: test 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 2009-10-14.12:04:11.132>
    created_at = <Date 2009-10-14.11:42:48.201>
    labels = ['invalid', 'library']
    title = 'multiprocessing.Pool() problem in windows'
    updated_at = <Date 2009-10-14.12:04:11.122>
    user = 'https://bugs.python.org/SirLalala'

    bugs.python.org fields:

    activity = <Date 2009-10-14.12:04:11.122>
    actor = 'amaury.forgeotdarc'
    assignee = 'none'
    closed = True
    closed_date = <Date 2009-10-14.12:04:11.132>
    closer = 'amaury.forgeotdarc'
    components = ['Library (Lib)']
    creation = <Date 2009-10-14.11:42:48.201>
    creator = 'SirLalala'
    dependencies = []
    files = ['15123']
    hgrepos = []
    issue_num = 7122
    keywords = []
    message_count = 2.0
    messages = ['93975', '93977']
    nosy_count = 2.0
    nosy_names = ['amaury.forgeotdarc', 'SirLalala']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue7122'
    versions = ['Python 2.6']

    @SirLalala
    Copy link
    Mannequin Author

    SirLalala mannequin commented Oct 14, 2009

    Maybe I didn't understand how multiprocessing works but when running the
    test code below I get 200+ processes in Windows and it never finishes.
    It works fine on Linux.

    @SirLalala SirLalala mannequin added the stdlib Python modules in the Lib dir label Oct 14, 2009
    @amauryfa
    Copy link
    Member

    This difference between Unix and Windows is documented there:
    http://docs.python.org/library/multiprocessing.html#windows
    Please carefully read the paragraph named "Safe importing of main module".

    You will certainly need to add a condition like
    if __name__ == '__main__':
    so that subprocesses (which start a new Python interpreter from the
    start) don't start another Pool themselves.

    @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
    stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant