ID EN
Multiprocessing

freeze_support

Python 3.11

Add support for when a program which uses multiprocessing has been frozen to produce a Windows executable. (Has been tested with py2exe, PyInstaller and cx_Freeze.)

Syntax

PYTHON
multiprocessing.freeze_support()

Examples

Example 1
PYTHON
from multiprocessing import Process, freeze_support

def f():
    print('hello world!')

if __name__ == '__main__':
    freeze_support()
    Process(target=f).start()

See Also

multiprocessing RuntimeError