#!/usr/bin/python3.8 # -*- coding: utf-8 -*- from multiprocessing import Value, set_start_method from ctypes import c_bool class Storage(): state = Value(c_bool, False) if __name__ == "__main__": set_start_method('spawn') # Traceback (most recent call last): # File "./test.py", line 54, in # set_start_method('spawn') # File "/usr/lib64/python3.5/multiprocessing/context.py", line 231, in set_start_method # raise RuntimeError('context has already been set') # RuntimeError: context has already been set # Traceback (most recent call last): # File "./test.py", line 54, in # set_start_method('spawn') # File "/usr/lib64/python3.8/multiprocessing/context.py", line 243, in set_start_method # raise RuntimeError('context has already been set') # RuntimeError: context has already been set