Does arcpy support multithreading?

503
2
07-24-2020 12:11 AM
ChrisMahlke2
New Contributor II

Does arcpy support mutlithreading?

I noticed in this thread a staff member said it does not.  However, the thread is old.

I am trying to use the ThreadPoolExecutor subclass of the Executor class in the concurrent.futures module and I am getting back errors when I include geoprocessing routines in my threading logic.

0 Kudos
2 Replies
JoshuaBixby
MVP Esteemed Contributor

You posted this question in ArcGIS API for Python‌ but ask about ArcPy (Python‌), the answer may differ between the two libraries.  Even with ArcPy, the answer may differ between ArcGIS Desktop/ArcMap and ArcGIS Pro, but I think it is more likely the answer is the same between the two.

The short answer is that Esri doesn't officially state whether ArcPy supports multi-threading or multi-processing.  Over the years Esri staff occasionally comment in forums and at conferences that ArcPy does not support multi-threading and you should use multi-processing instead, but I would not go as far as saying those comments by Esri staff make for an official statement on the topic.

Given the ArcPy site package/library kept the same name between ArcGIS Desktop/ArcMap and ArcGIS Pro, I have assumed the underlying architecture of ArcPy didn't change between Desktop/ArcMap and Pro.  Although the Python version changed between Desktop/ArcMap and Pro, a vast majority of the ArcPy functions, classes, and methods outside of the mapping module remained the same.

The ArcGIS Pro framework, or parts of it, is definitely multi-threaded, and ArcGIS Pro has more geoprocessing tools that support parallel processing, but I don't think any of that implies ArcPy supports multi-threading in ArcGIS Pro.

0 Kudos
evaaasate
New Contributor

@JoshuaBixby wrote:

You posted this question in ArcGIS API for Python ‌ but ask about ArcPy (Python ‌), the answer may differ between the two libraries.  Even with ArcPy, the answer may differ between ArcGIS Desktop/ArcMap and ArcGIS Pro, but I think it is more likely the answer is the same between the two.

 

The short answer is that Esri doesn't officially state whether ArcPy supports multi-threading or multi-processing.  Over the years Esri staff occasionally comment in forums and at conferences that ArcPy does not support multi-threading and you should use multi-processing instead, but I would not go as far as saying those comments by Esri staff make for an official statement on the topic.

 

Given the ArcPy site package/library kept the same name between sillas gaming ArcGIS Desktop/ArcMap and ArcGIS Pro, I have assumed the underlying architecture of ArcPy didn't change between Desktop/ArcMap and Pro.  Although the Python version changed between Desktop/ArcMap and Pro, a vast majority of the ArcPy functions, classes, and methods outside of the mapping module remained the same.

 

The ArcGIS Pro framework, or parts of it, is definitely multi-threaded, and ArcGIS Pro has more geoprocessing tools that support parallel processing, but I don't think any of that implies ArcPy supports multi-threading in ArcGIS Pro.



Yes support multi-threading and system for x64.

0 Kudos