mirror of
https://github.com/volatilityfoundation/volatility3.git
synced 2026-08-29 03:09:48 +02:00
Make parallelism options more well defined.
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user