Select to view content in your preferred language

Add ability to disable ArcGIS Pro 3.6 new "Foreground Thread" processing via ToolValidator class and toolvalidation code

217
0
a week ago
Status: Open
Labels (1)
MarcoBoeringa
MVP Alum

Considering I have run into a number of major issues with a custom written arcpy/Python geoprocessing tool when attempting to run the code on the ArcGIS Pro 3.6 new option of "Foreground Thread" processing (e.g. partly documented here: https://community.esri.com/t5/python-documents/python-in-arcgis-pro-3-6-faq/ta-p/1619754), I think it wise, regardless of whether ESRI fixes anything, if users of Pro 3.6+ were given the ability to disable "Foreground Thread" and / or background "Geoprocessing Thread" processing via arcpy Python code.

Clearly, based on my experience so far, especially with custom written code that uses Python's own multi-threading and multi-processing options like mine, there are possibly incompatibilities with the new "Foreground Thread" processing.

It would therefor be wise to have an option to turn it off. This will likely require extending the ArcGIS ModelBuilder "ToolValidator class", as obviously, once the script runs on either "Foreground Thread" or "Geoprocessing Thread", switching between the two will be impossible, so this has to be set before actual tool execution starts. Adding this option to the "ToolValidator" class will allow custom arcpy toolvalidation code to disable the "Foreground Thread", allowing to safely run tools that technically can only be run on the background "Geoprocessing Thread".

Please make this an option on the ToolValidator class, to allow fine grained control by developers, instead of some global switch in ArcGIS Pro's configuration, which might result in incompatibility with a global setting that is not in correspondence with the needs of a particular Python script, which would be a major headache for developers.