You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Python version (& distribution if applicable, e.g. Anaconda): Python 3.6.9
Using VS Code or Visual Studio:VS Code
Actual behavior
When I launch a simple program that involves multiprocessing, upon firing of another process, the preLaunchTask runs more than one time (once per process as I understand). Same goes for the postDebugTask, which seems to run more than one time.
Expected behavior
The preLaunchTask should run once only, as well as the postDebugTask.
from multiprocessing import Pool
import traceback
def f(x):
return x * x
if __name__ == '__main__':
# start 4 worker processes
try:
with Pool(processes=4) as pool:
# print "[0, 1, 4,..., 81]"
print(pool.map(f, range(10)))
print("For the moment, the pool remains available for more work")
except:
print(traceback.print_exc())
# exiting the 'with'-block has stopped the pool
print("Now the pool is closed and no longer available")
I also needed the fix for connection refused error that I have in my version of debug.py.
It seems, by the output of this, that when my process forks, it runs the preLaunchTask a 2nd time, but for each process that terminates (4 in this example), it runs the postDebugTask.
The text was updated successfully, but these errors were encountered:
@int19h as discussed, I think you've got all that's needed to repro easily.
omartin2010
changed the title
multiprocessing will result in running preLaunchTask and postDebugTasks more than once
multiprocessing triggers preLaunchTask and postDebugTasks more than once
Apr 3, 2020
omartin2010
changed the title
multiprocessing triggers preLaunchTask and postDebugTasks more than once
multiprocessing triggers preLaunchTask and postDebugTask more than once
Apr 3, 2020
Environment data
Actual behavior
When I launch a simple program that involves
multiprocessing
, upon firing of another process, the preLaunchTask runs more than one time (once per process as I understand). Same goes for the postDebugTask, which seems to run more than one time.Expected behavior
The
preLaunchTask
should run once only, as well as thepostDebugTask
.Steps to reproduce:
launch.json
:tasks.json
:mp.py
looks like thisI also needed the fix for
connection refused error
that I have in my version ofdebug.py
.It seems, by the output of this, that when my process forks, it runs the
preLaunchTask
a 2nd time, but for each process that terminates (4 in this example), it runs thepostDebugTask
.The text was updated successfully, but these errors were encountered: