<?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 Background Process in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/background-process/m-p/1001899#M5743</link>
    <description>&lt;P&gt;I have a long running process that I need to parse out to run concurrently on multiple background threads. But I haven't been successful running.&lt;/P&gt;&lt;P&gt;I've been trying it using 'async', 'QueuedTask.Run', 'Enumerable and "await Task.WhenAll(tasks)"' in various combinations, but my code always waits for each process to finish.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions (or an example) would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used Enumerable for one of my tests (but code always stops until Enumerable finishes) :&lt;/P&gt;&lt;P&gt;var tasks = Enumerable.Range(0, 10).Select(i =&amp;gt; AsyncTest()).ToList();&lt;BR /&gt;await Task.WhenAny(tasks);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private async Task&amp;lt;string&amp;gt; AsyncTest()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;double increment = 100.0 / Convert.ToDouble(100000000);&lt;BR /&gt;for (int i = 0; i &amp;lt; 100000000; i++)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;int result = Convert.ToInt32(i / 1) + i;&lt;BR /&gt;result = Convert.ToInt32(i / 1) + i;&lt;BR /&gt;result = Convert.ToInt32(i / 1) + i;&lt;BR /&gt;result = Convert.ToInt32(i / 1) + i;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;return "Done";&lt;BR /&gt;}&lt;/P&gt;</description>
    <pubDate>Mon, 16 Nov 2020 21:00:45 GMT</pubDate>
    <dc:creator>rlwarford</dc:creator>
    <dc:date>2020-11-16T21:00:45Z</dc:date>
    <item>
      <title>Background Process</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/background-process/m-p/1001899#M5743</link>
      <description>&lt;P&gt;I have a long running process that I need to parse out to run concurrently on multiple background threads. But I haven't been successful running.&lt;/P&gt;&lt;P&gt;I've been trying it using 'async', 'QueuedTask.Run', 'Enumerable and "await Task.WhenAll(tasks)"' in various combinations, but my code always waits for each process to finish.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any suggestions (or an example) would be appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used Enumerable for one of my tests (but code always stops until Enumerable finishes) :&lt;/P&gt;&lt;P&gt;var tasks = Enumerable.Range(0, 10).Select(i =&amp;gt; AsyncTest()).ToList();&lt;BR /&gt;await Task.WhenAny(tasks);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;private async Task&amp;lt;string&amp;gt; AsyncTest()&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;QueuedTask.Run(() =&amp;gt;&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;double increment = 100.0 / Convert.ToDouble(100000000);&lt;BR /&gt;for (int i = 0; i &amp;lt; 100000000; i++)&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;int result = Convert.ToInt32(i / 1) + i;&lt;BR /&gt;result = Convert.ToInt32(i / 1) + i;&lt;BR /&gt;result = Convert.ToInt32(i / 1) + i;&lt;BR /&gt;result = Convert.ToInt32(i / 1) + i;&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;});&lt;/P&gt;&lt;P&gt;return "Done";&lt;BR /&gt;}&lt;/P&gt;</description>
      <pubDate>Mon, 16 Nov 2020 21:00:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/background-process/m-p/1001899#M5743</guid>
      <dc:creator>rlwarford</dc:creator>
      <dc:date>2020-11-16T21:00:45Z</dc:date>
    </item>
  </channel>
</rss>

