Author Topic: Interprocess Communication  (Read 1628 times)

0 Members and 1 Guest are viewing this topic.

WILL HATCH

  • Bull Frog
  • Posts: 450
Interprocess Communication
« on: May 02, 2013, 04:52:37 PM »
Does anybody have any experience with passing data between processes?  I'm extracting attribute data from a large number of DWGs to display in a palette with options to make changes and push those changes back out.  In an effort to make this whole process nicer for the user I'd like to offload the work being done to other instances of autocad so the user does not have to sit for 30+ seconds while AutoCAD is completely frozen.  I first considered memory mapped files but that seems to be tricky as the size of the return results is unpredictable, I'm currently looking into pipes but worried about the possibility of collisions.  Any input greatly appreciated!

TheMaster

  • Guest
Re: Interprocess Communication
« Reply #1 on: May 02, 2013, 05:26:50 PM »
Does anybody have any experience with passing data between processes?  I'm extracting attribute data from a large number of DWGs to display in a palette with options to make changes and push those changes back out.  In an effort to make this whole process nicer for the user I'd like to offload the work being done to other instances of autocad so the user does not have to sit for 30+ seconds while AutoCAD is completely frozen.  I first considered memory mapped files but that seems to be tricky as the size of the return results is unpredictable, I'm currently looking into pipes but worried about the possibility of collisions.  Any input greatly appreciated!

If you're process took minutes and the user had to wait, I would agree that offloading it to other instances of AutoCAD or AcCoreConsole might make sense, but the overhead of doing that would probably defeat the purpose, if the user is only waiting 30-60 seconds.

Starting up the instances and transferring the data could easily take longer than the time the user is waiting in a single instance, if it's < 60 seconds.

Typically, you would start other AutoCAD instances using COM and implement a COM server that is loaded into the AutoCAD process. From another process, you can talk to it using the GetInterfaceObject() method of the AcadApplication COM wrapper.

If you go that route, make sure your COM server is derived from System.ServiceModel.ServicedComponent, otherwise there will be threading issues.

exmachina

  • Guest
Re: Interprocess Communication
« Reply #2 on: May 05, 2013, 03:00:12 AM »
Memory mapped files are fast and would not have a significant impact on the performance of "data transmission". It is much faster to use memory mapped files that use binarywriter/reader. Anyway, it seems to me a bad idea to use two instances. I think it's better to show a progress bar in a dialog box, and if necessary the user can go to drink a coffee.

Sorry, i do not speak English