Skip to content

Commit

Permalink
lisa.trace: Avoid forking multiprocessing.Pool
Browse files Browse the repository at this point in the history
FIX

Since they can cause deadlocks in multithreaded applications, use the
"spawn" method even though it is slower.
  • Loading branch information
douglas-raillard-arm committed Nov 3, 2021
1 parent c0d7588 commit 17a94d8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lisa/trace.py
Original file line number Diff line number Diff line change
Expand Up @@ -4070,7 +4070,7 @@ def _parse_raw_events(self, events):
use_mp = self._cache.max_mem_size >= math.inf and nr_processes > 1

if use_mp:
with multiprocessing.Pool(processes=nr_processes) as pool:
with multiprocessing.get_context('spawn').Pool(processes=nr_processes) as pool:
data_list = pool.map(self._mp_parse_worker, events, chunksize=chunk_size)

df_map = {
Expand Down

0 comments on commit 17a94d8

Please sign in to comment.