<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Python - arcpy - multiprocessing in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1613281#M74162</link>
    <description>&lt;P&gt;I have a number of Python/arcpy applications that use multiprocessing. Not all arcpy commands like to be multiprocessed but some do work. For example, I can create multiple processes that all "append" into&amp;nbsp; the same SQLServer table from different sources simultaneously.&amp;nbsp; &amp;nbsp;With ArcGIS Pro v3.3.2 I am finding Python /arcpy applications that multiprocess that used work no longer do. The applications worked with v3.2.3.&lt;/P&gt;&lt;P&gt;Is anybody else running into such issues?&lt;/P&gt;&lt;P&gt;Test code below to demonstrate issue. I have installed ArcGIS Pro v3.3.2. The results can vary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Run as is. The results should produce "&amp;lt;-- did something ..." statement 5 times. This should work.&lt;BR /&gt;- Uncomment line #2 (from arcpy import Exists). Run app. I start to see issues here in that I no longer get 5 statements. Other errors can appear.&lt;BR /&gt;- Uncomment line #3 (time.sleep(15)). Run app. Maybe this line helps sometimes\?&lt;BR /&gt;- Uncomment line #9 (print(Exists("c:\dev\test-upgrade")). Run app. Errors.&lt;BR /&gt;- Uncomment line #24 (# time.sleep(10)). Run app. In the past, I have used delays to get the new processes to spawn properly.&lt;/P&gt;&lt;P&gt;---------- ---------- ---------- ----------&lt;BR /&gt;import time&lt;BR /&gt;# from arcpy import Exists&lt;BR /&gt;# time.sleep(15)&lt;BR /&gt;from multiprocessing import Process&lt;BR /&gt;import random&lt;/P&gt;&lt;P&gt;def do_something(title):&lt;BR /&gt;&amp;nbsp; &amp;nbsp;print(" ---&amp;gt; do something", title)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;# print(Exists("c:\work\a-file-name"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;time.sleep(random.randint(5, 15))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;print(" &amp;lt;--- did something", title)&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;&amp;nbsp; &amp;nbsp;to_process = [ "Albany", "Boston", "Chicago", "Detroit", "Emporia" ]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;procs = []&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;for item in to_process:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(" ===&amp;gt; process spawn: ", item)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; proc = Process(target = do_something, args = (item, ))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; proc.start()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; procs.append(proc)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # time.sleep(10)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;for proc in procs:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; proc.join()&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;BR /&gt;&amp;nbsp; &amp;nbsp;main()&lt;BR /&gt;---------- ---------- ---------- ----------&lt;/P&gt;</description>
    <pubDate>Fri, 09 May 2025 15:39:17 GMT</pubDate>
    <dc:creator>GregHorne</dc:creator>
    <dc:date>2025-05-09T15:39:17Z</dc:date>
    <item>
      <title>Python - arcpy - multiprocessing</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1613281#M74162</link>
      <description>&lt;P&gt;I have a number of Python/arcpy applications that use multiprocessing. Not all arcpy commands like to be multiprocessed but some do work. For example, I can create multiple processes that all "append" into&amp;nbsp; the same SQLServer table from different sources simultaneously.&amp;nbsp; &amp;nbsp;With ArcGIS Pro v3.3.2 I am finding Python /arcpy applications that multiprocess that used work no longer do. The applications worked with v3.2.3.&lt;/P&gt;&lt;P&gt;Is anybody else running into such issues?&lt;/P&gt;&lt;P&gt;Test code below to demonstrate issue. I have installed ArcGIS Pro v3.3.2. The results can vary.&amp;nbsp;&lt;/P&gt;&lt;P&gt;- Run as is. The results should produce "&amp;lt;-- did something ..." statement 5 times. This should work.&lt;BR /&gt;- Uncomment line #2 (from arcpy import Exists). Run app. I start to see issues here in that I no longer get 5 statements. Other errors can appear.&lt;BR /&gt;- Uncomment line #3 (time.sleep(15)). Run app. Maybe this line helps sometimes\?&lt;BR /&gt;- Uncomment line #9 (print(Exists("c:\dev\test-upgrade")). Run app. Errors.&lt;BR /&gt;- Uncomment line #24 (# time.sleep(10)). Run app. In the past, I have used delays to get the new processes to spawn properly.&lt;/P&gt;&lt;P&gt;---------- ---------- ---------- ----------&lt;BR /&gt;import time&lt;BR /&gt;# from arcpy import Exists&lt;BR /&gt;# time.sleep(15)&lt;BR /&gt;from multiprocessing import Process&lt;BR /&gt;import random&lt;/P&gt;&lt;P&gt;def do_something(title):&lt;BR /&gt;&amp;nbsp; &amp;nbsp;print(" ---&amp;gt; do something", title)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;# print(Exists("c:\work\a-file-name"))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;time.sleep(random.randint(5, 15))&lt;BR /&gt;&amp;nbsp; &amp;nbsp;print(" &amp;lt;--- did something", title)&lt;/P&gt;&lt;P&gt;def main():&lt;BR /&gt;&amp;nbsp; &amp;nbsp;to_process = [ "Albany", "Boston", "Chicago", "Detroit", "Emporia" ]&lt;BR /&gt;&amp;nbsp; &amp;nbsp;procs = []&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp;for item in to_process:&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(" ===&amp;gt; process spawn: ", item)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; proc = Process(target = do_something, args = (item, ))&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; proc.start()&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; procs.append(proc)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; # time.sleep(10)&lt;BR /&gt;&amp;nbsp; &amp;nbsp;for proc in procs:&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; proc.join()&lt;/P&gt;&lt;P&gt;if __name__ == '__main__':&lt;BR /&gt;&amp;nbsp; &amp;nbsp;main()&lt;BR /&gt;---------- ---------- ---------- ----------&lt;/P&gt;</description>
      <pubDate>Fri, 09 May 2025 15:39:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1613281#M74162</guid>
      <dc:creator>GregHorne</dc:creator>
      <dc:date>2025-05-09T15:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Python - arcpy - multiprocessing</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1613739#M74173</link>
      <description>&lt;P&gt;Solved.&amp;nbsp; The thing that was causing all of my wacky multiprocessing&amp;nbsp; issues is ---&amp;gt;&amp;nbsp;&lt;SPAN&gt;&lt;EM&gt;Cisco&lt;/EM&gt; Secure Endpoint (formerly &lt;EM&gt;AMP&lt;/EM&gt; for Endpoints)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 May 2025 17:47:13 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1613739#M74173</guid>
      <dc:creator>GregHorne</dc:creator>
      <dc:date>2025-05-12T17:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: Python - arcpy - multiprocessing</title>
      <link>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1614566#M74184</link>
      <description>&lt;P&gt;Thanks for sharing what you found.&amp;nbsp; It used to just be antivirus software that could cause issues, but the breadth and depth of security software has exploded over the past decade, especially in corporate environments.&amp;nbsp; Often times the big-brother software impacts performance, but occasionally it can break functionality as well.&lt;/P&gt;</description>
      <pubDate>Wed, 14 May 2025 14:40:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/python-arcpy-multiprocessing/m-p/1614566#M74184</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2025-05-14T14:40:29Z</dc:date>
    </item>
  </channel>
</rss>

