From 778130191adbae617ce07d404922f2c6b1e63b28 Mon Sep 17 00:00:00 2001 From: Thomas Mansencal Date: Tue, 24 Dec 2024 12:49:56 +1300 Subject: [PATCH] Ensure that `colour.utilities.ParallelForMultiprocess` node always spawns new processes. --- colour/utilities/network.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/colour/utilities/network.py b/colour/utilities/network.py index 1d9c0b84f..733e00f61 100644 --- a/colour/utilities/network.py +++ b/colour/utilities/network.py @@ -29,6 +29,7 @@ from __future__ import annotations import concurrent.futures +import multiprocessing import os import threading import typing @@ -2304,8 +2305,9 @@ def process(self) -> None: self.log(f'Processing "{node}" node...') results = {} + context = multiprocessing.get_context("spawn") with concurrent.futures.ProcessPoolExecutor( - max_workers=self.get_input("processes") + mp_context=context, max_workers=self.get_input("processes") ) as executor: futures = [ executor.submit(self.get_input("task"), (i, element, node, self))