diff --git a/volatility/framework/constants/__init__.py b/volatility/framework/constants/__init__.py index d08dfd8f2..9e0365deb 100644 --- a/volatility/framework/constants/__init__.py +++ b/volatility/framework/constants/__init__.py @@ -56,5 +56,8 @@ MAC_BANNERS_PATH = os.path.join(CACHE_PATH, "mac_banners.cache") ProgressCallback = Optional[Callable[[float, str], None]] -# Options are 'multiprocessing', 'threading' or None -PARALLELISM = 'multiprocessing' +PARALLELISM_OFF = 0 +PARALLELISM_THREADING = 1 +PARALLELISM_MULTIPROCESSING = 2 + +PARALLELISM = PARALLELISM_MULTIPROCESSING diff --git a/volatility/framework/layers/physical.py b/volatility/framework/layers/physical.py index 9b0ad6562..7e8f9de86 100644 --- a/volatility/framework/layers/physical.py +++ b/volatility/framework/layers/physical.py @@ -104,7 +104,7 @@ class FileLayer(interfaces.layers.DataLayerInterface): self._file_ = None # type: Optional[IO[Any]] self._size = None # type: Optional[int] # Construct the lock now (shared if made before threading) in case we ever need it - if constants.PARALLELISM == 'threading': + if constants.PARALLELISM == constants.PARALLELISM_THREADING: self._lock = threading.Lock() else: # We don't need a lock for multiprocessing because child threads can't inherit file descriptors by default