multiprocessing (Python 2.4/2.5 Backport)

2.6.2.1 · abandoned · verified Fri Apr 17

This PyPI package `multiprocessing` (version 2.6.2.1) is a backport of the standard library `multiprocessing` module, designed specifically for Python 2.4 and 2.5. It provides process-based parallelism for these very old, end-of-life Python versions. It is not intended for use with Python 2.6+ or Python 3.x, which include `multiprocessing` in their standard libraries.

Common errors

Warnings

Install

Imports

Quickstart

A basic example demonstrating how to create and run a process using the backported `multiprocessing` module. This code is written for Python 2.x syntax.

# For Python 2.4/2.5 using the multiprocessing backport
import multiprocessing
import os

def worker_function(name):
    print "Worker %s: PID %s" % (name, os.getpid())
    return

if __name__ == '__main__':
    # The 'if __name__ == '__main__':` guard is crucial, especially on Windows.
    process = multiprocessing.Process(target=worker_function, args=('Alice',))
    process.start()
    process.join()
    print "Main process: PID %s" % os.getpid()

view raw JSON →