<?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 ArcObjects in background threads - performance issues (ArcGIS 10.0, .NET Add-ins) in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41332#M1077</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently working on an Add-in for ArcMap 10.0. As part of this, I need to interrogate a geodatabase containing point feature classes, to see which of these points lie within an input polygon, and sum various attributes associated these relevant points. As the geodatabase is very large, this can take a fair while (~few minutes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously making ArcMap hang while this calculation is taking place is not ideal, so I'd like to have the geodatabase access &amp;amp; interrogation take place in a background thread. Unfortunately, this seems to increase the calculation time by a factor of ~5-10 - seemingly because all the calls to COM components are getting held up somewhere. I've tried a number of methods to speed things up, but with no success (&lt;SPAN style="font-family: courier new,courier;"&gt;BackgroundWorker&lt;/SPAN&gt;s, &lt;SPAN style="font-family: courier new,courier;"&gt;Thread&lt;/SPAN&gt;s with the &lt;SPAN style="font-family: courier new,courier;"&gt;STAThread&lt;/SPAN&gt; attribute, &lt;SPAN style="font-family: courier new,courier;"&gt;Control.BeginInvoke&lt;/SPAN&gt; methods...); with the exact same code, it takes several times longer in a background/non-UI thread. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any advice on how to make ArcObjects access work with any degree of speed when not run in the UI thread? Any insight would be much appreciated; I have run out of ideas!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 07 Nov 2014 19:14:57 GMT</pubDate>
    <dc:creator>MurrayPurves</dc:creator>
    <dc:date>2014-11-07T19:14:57Z</dc:date>
    <item>
      <title>ArcObjects in background threads - performance issues (ArcGIS 10.0, .NET Add-ins)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41332#M1077</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently working on an Add-in for ArcMap 10.0. As part of this, I need to interrogate a geodatabase containing point feature classes, to see which of these points lie within an input polygon, and sum various attributes associated these relevant points. As the geodatabase is very large, this can take a fair while (~few minutes).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Obviously making ArcMap hang while this calculation is taking place is not ideal, so I'd like to have the geodatabase access &amp;amp; interrogation take place in a background thread. Unfortunately, this seems to increase the calculation time by a factor of ~5-10 - seemingly because all the calls to COM components are getting held up somewhere. I've tried a number of methods to speed things up, but with no success (&lt;SPAN style="font-family: courier new,courier;"&gt;BackgroundWorker&lt;/SPAN&gt;s, &lt;SPAN style="font-family: courier new,courier;"&gt;Thread&lt;/SPAN&gt;s with the &lt;SPAN style="font-family: courier new,courier;"&gt;STAThread&lt;/SPAN&gt; attribute, &lt;SPAN style="font-family: courier new,courier;"&gt;Control.BeginInvoke&lt;/SPAN&gt; methods...); with the exact same code, it takes several times longer in a background/non-UI thread. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Does anyone have any advice on how to make ArcObjects access work with any degree of speed when not run in the UI thread? Any insight would be much appreciated; I have run out of ideas!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 19:14:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41332#M1077</guid>
      <dc:creator>MurrayPurves</dc:creator>
      <dc:date>2014-11-07T19:14:57Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects in background threads - performance issues (ArcGIS 10.0, .NET Add-ins)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41333#M1078</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Murray,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;One option would be to refactor your geodatabase query logic into a &lt;A href="http://resources.arcgis.com/en/help/arcobjects-net/conceptualhelp/index.html#//000100000mrs000000"&gt;Custom Geoprocessing Function Tool&lt;/A&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This would enable you to execute the logic in a separate/background thread while still retaining the necessary performance.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 07 Nov 2014 19:58:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41333#M1078</guid>
      <dc:creator>ErinBrimhall</dc:creator>
      <dc:date>2014-11-07T19:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects in background threads - performance issues (ArcGIS 10.0, .NET Add-ins)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41334#M1079</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you already take a look at this article?: &lt;A href="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000100000000" title="http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#//000100000100000000"&gt;ArcObjects 10 .NET SDK Help&lt;/A&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 09:04:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41334#M1079</guid>
      <dc:creator>JavierArtero</dc:creator>
      <dc:date>2014-11-10T09:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects in background threads - performance issues (ArcGIS 10.0, .NET Add-ins)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41335#M1080</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Erin - thanks for the info; I'll have a look into the geoprocessing option next time I get a chance.&lt;/P&gt;&lt;P&gt;Javier - thanks for the reference; I have read through that, and the STA threading methods it explains still seem very slow compared to single-threaded... I'll read through it more thoroughly though and see if there's anything I haven't tried.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Cheers&lt;/P&gt;&lt;P&gt;Murray&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 10:20:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41335#M1080</guid>
      <dc:creator>MurrayPurves</dc:creator>
      <dc:date>2014-11-10T10:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: ArcObjects in background threads - performance issues (ArcGIS 10.0, .NET Add-ins)</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41336#M1081</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I can give you only one advice then: Just make sure that there are &lt;STRONG&gt;no shared&lt;/STRONG&gt; ArcObjects objects across the threads. &lt;/P&gt;&lt;P&gt;Ideally you should pass a string with the path of the workspace and create &lt;STRONG&gt;all&lt;/STRONG&gt; the necessary objects &lt;STRONG&gt;inside the thread&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;For further info, when I've dealt with threading and ArcObjects, i've used System.Threading.Thread in STA apartment state.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 10 Nov 2014 10:49:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/arcobjects-in-background-threads-performance/m-p/41336#M1081</guid>
      <dc:creator>JavierArtero</dc:creator>
      <dc:date>2014-11-10T10:49:48Z</dc:date>
    </item>
  </channel>
</rss>

