I am trying to create a script tool in ArcGIS Pro 2.3, which calls existing python modules where multiprocessing is taking place.
When the parallel processes are started, instead of new python processes, several new instances of ArcGISPro are opened.
A very simplified code for a script tool to illustrate this:
import multiprocessing, arcpy, sys
from multiprocessing import Pool
text = arcpy.GetParameterAsText(0)
def testFunc(param):
return "Processed: " + param
if __name__ == "__main__":
cpuNum = multiprocessing.cpu_count() - 1
pool = Pool(processes=cpuNum)
newText = pool.map(testFunc, text)
pool.close
pool.join
print("Output :" + str(newText))
When running the same code from command prompt, it works fine:

How can this code be executed successfully from a script tool in ArcGIS Pro?