<?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 Doing multi-threading jobs inside AutoCAD .Net plugin in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/doing-multi-threading-jobs-inside-autocad-net-plugin/m-p/5794214#M38799</link>
    <description>&lt;P&gt;I am aware that Autocad APIs are not supposed to be called/used in multi-threading. But how about doing a multi-thread job(in an Autocad .Net plugin) that does not involve any specific Autocad calls/type?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The situation is like this:&lt;BR /&gt;1.some CAD polylines are fetched through APIs, their properties that are of interest are wrapped in custome types and then&lt;BR /&gt;2.In another layer some multi-thread calculations are done against these custome types.&lt;BR /&gt;3.The application custome types writing their results back to the CAD polylines through Autocad APIs.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Only step two is done in multi-threads.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The application uses StartTransaction() method to get the Transaction object. I haven't experienced any crashing so far for many years. But now I am trying to use StratOpenCloseTransasction() it crashes many times. Specially it crashes when Editor.Rengen() is called as I think it goes through every object in database and perhaps some are corrupted. I did narrow down the problem and one of the causes apparently is this multi-threading.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is there any reason that CAD should crashes in calling multi-threads although no APIs is engaged? Am I safe to use multi-threading in this way?&lt;BR /&gt;Does StartTransaction() handles objects better than StartOpenCloseTransaction in terms of disposing them? As I didn't experience crashing on that.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;BR /&gt;Ali&lt;/P&gt;</description>
    <pubDate>Sat, 29 Aug 2015 08:30:10 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2015-08-29T08:30:10Z</dc:date>
    <item>
      <title>Doing multi-threading jobs inside AutoCAD .Net plugin</title>
      <link>https://forums.autodesk.com/t5/net-forum/doing-multi-threading-jobs-inside-autocad-net-plugin/m-p/5794214#M38799</link>
      <description>&lt;P&gt;I am aware that Autocad APIs are not supposed to be called/used in multi-threading. But how about doing a multi-thread job(in an Autocad .Net plugin) that does not involve any specific Autocad calls/type?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The situation is like this:&lt;BR /&gt;1.some CAD polylines are fetched through APIs, their properties that are of interest are wrapped in custome types and then&lt;BR /&gt;2.In another layer some multi-thread calculations are done against these custome types.&lt;BR /&gt;3.The application custome types writing their results back to the CAD polylines through Autocad APIs.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Only step two is done in multi-threads.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;The application uses StartTransaction() method to get the Transaction object. I haven't experienced any crashing so far for many years. But now I am trying to use StratOpenCloseTransasction() it crashes many times. Specially it crashes when Editor.Rengen() is called as I think it goes through every object in database and perhaps some are corrupted. I did narrow down the problem and one of the causes apparently is this multi-threading.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Is there any reason that CAD should crashes in calling multi-threads although no APIs is engaged? Am I safe to use multi-threading in this way?&lt;BR /&gt;Does StartTransaction() handles objects better than StartOpenCloseTransaction in terms of disposing them? As I didn't experience crashing on that.&lt;/P&gt;&lt;P&gt;Many thanks,&lt;BR /&gt;Ali&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 08:30:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/doing-multi-threading-jobs-inside-autocad-net-plugin/m-p/5794214#M38799</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2015-08-29T08:30:10Z</dc:date>
    </item>
    <item>
      <title>Re : Doing multi-threading jobs inside AutoCAD .Net plugin</title>
      <link>https://forums.autodesk.com/t5/net-forum/doing-multi-threading-jobs-inside-autocad-net-plugin/m-p/5794279#M38800</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can do some multi thread job in an AutoCAD plug-in, even with some AutoCAD non database resident objects as those of the Geometry namespace.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In &lt;A href="http://www.theswamp.org/index.php?topic=44312.msg496481#msg496481" target="_blank"&gt;this example&lt;/A&gt;, a parallel task is used to build a Point3dTree (&lt;A href="https://www.google.fr/url?sa=t&amp;amp;rct=j&amp;amp;q=&amp;amp;esrc=s&amp;amp;source=web&amp;amp;cd=2&amp;amp;cad=rja&amp;amp;uact=8&amp;amp;ved=0CCwQFjABahUKEwikr_CUmc7HAhWGWBQKHY0JAXE&amp;amp;url=https%3A%2F%2Fen.wikipedia.org%2Fwiki%2FK-d_tree&amp;amp;ei=l5jhVeSHGIaxUY2ThIgH&amp;amp;usg=AFQjCNHYDxF4BrWhqowocKV8Yl2hHDjjXw" target="_blank"&gt;kd tree&lt;/A&gt; of AutoCAD Point3d instances).&lt;/P&gt;</description>
      <pubDate>Sat, 29 Aug 2015 11:36:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/doing-multi-threading-jobs-inside-autocad-net-plugin/m-p/5794279#M38800</guid>
      <dc:creator>_gile</dc:creator>
      <dc:date>2015-08-29T11:36:59Z</dc:date>
    </item>
  </channel>
</rss>

